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
List<Era> eras = System.Enum | |
.GetValues(typeof(Era)) | |
.Cast<Era>() | |
.ToList(); | |
enum Era | |
{ | |
Paleolitico, | |
Neolitico, | |
Mesozoico, |
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
var flow = Observable.Range(1, 30); | |
flow = flow.Scan((current, previous) => | |
{ | |
(current + " - " + previous).Dump(); | |
return previous; | |
}); | |
flow.Subscribe(); |
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
var flusso = Enumerable.Range(1,30).ToArray(); | |
flusso.TakeWhile((_, pos) => pos <= flusso.Count()).Select((_, pos) => flusso.Skip(pos).Take(3)).Where(w => w.Count() == 3).Dump(); |
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
Func<int, int> triple = x => x * 3; | |
var range = Enumerable.Range(1, 3); | |
var triples = range.Select(triple); |
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
private readonly IList<string> _listOfNames = new List<string>(); | |
public virtual IReadOnlyList<string> ListOfNames => _listOfNames.ToList(); |
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
static async Task DoSomethingAsync() | |
{ | |
Debug.WriteLine("B"); | |
Debug.WriteLine(Thread.CurrentThread.ManagedThreadId); | |
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false); | |
Debug.WriteLine("C"); | |
Debug.WriteLine(Thread.CurrentThread.ManagedThreadId); | |
} | |
private async void Form1_Load(object sender, EventArgs e) |
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
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); | |
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); | |
string version = fvi.FileVersion; |
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
void Main() | |
{ | |
var kanban = new KanbanBoard | |
{ | |
Id = "_todo", | |
Title = "To Do (drag me)", | |
Class = "info", | |
Items = new List<KanbanItem> | |
{ | |
new KanbanItem{ |
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 void ControlInvokeRequired(Control control, Action action) | |
{ | |
if (control.InvokeRequired) control.Invoke(new MethodInvoker(delegate { action(); })); | |
} |
NewerOlder