This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ObservableCollectionHelpers | |
{ | |
public static void Replace<T>(this ObservableCollection<T> collection, IEnumerable<T> novosItens) | |
{ | |
ArgumentNullException.ThrowIfNull(collection); | |
ArgumentNullException.ThrowIfNull(novosItens); | |
var numeroColunasColecao = collection.Count; | |
var numeroColunasNovosItens = novosItens.Count(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UrlFactory | |
{ | |
private Dictionary<string, string> _parameters; | |
private string _url; | |
public UrlFactory(string url) | |
{ | |
_url = url; | |
_parameters = new Dictionary<string, string>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WindowExtension | |
{ | |
public static bool? ShowDialog(this Window window, Window parentWindow) | |
{ | |
window.Owner = parentWindow; | |
return window.ShowDialog(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ObservableCollectionExtensions | |
{ | |
public static void AddRange<T>(this ObservableCollection<T> lista, IEnumerable<T> items) | |
{ | |
foreach(var item in items) | |
{ | |
lista.Add(item); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT A.NF_SAIDA 'Nota fiscal', | |
A.FILIAL 'Filial', | |
B.UF 'Estado', | |
B.CIDADE 'Cidade', | |
'' 'Região', | |
'' 'Gerente', | |
A.AGENTE 'Representante', | |
'' 'Canal de vendas', | |
'' 'Segmento de vendas', | |
C.GRIFFE 'Marca', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading.Tasks; | |
public static class HttpClientExtensions | |
{ | |
public static async Task<HttpResponseMessage> PatchAsync(this HttpClient client, Uri requestUri, HttpContent content) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: | |
// const catImage = await ImageFromUrl('./img/cat.png'); | |
async function ImageFromUrl(urlImage: string): Promise<HTMLImageElement> { | |
return new Promise<HTMLImageElement>(resolve => { | |
let base = new Image(); | |
base.src = urlImage; | |
base.onload = function() { | |
resolve(base); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="wrapper" :class="classNivel"> | |
<div class="container"> | |
<img :src="urlFoto" /> | |
<div class="comentario"> | |
<div class="topo"> | |
<a :href="urlPerfil" class="autor">{{ autor }}</a> - | |
<span class="tempo">{{ tempo }}</span> | |
</div> | |
<div>{{ texto }}</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of usage: | |
// var color = "#FF0000".ToBrush(); | |
public static class HexToBrushExtension | |
{ | |
public static SolidColorBrush ToBrush(this string value) | |
{ | |
var converter = new BrushConverter(); | |
return (SolidColorBrush)converter.ConvertFromString(value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Net | |
open System.IO | |
let download (url: string) = | |
use wc = new WebClient() | |
wc.DownloadString(url) | |
let saveOnDisk fileName text = | |
File.WriteAllText(fileName, text) |
NewerOlder