static async Task Main(string[] args) { //1. named method await NamedMethod(); //2. unnamed method Func <Task> unnamed = async() => { await Task.Delay(1000); Console.WriteLine("Unnamed Method"); }; await unnamed(); //3. Unnamed method with result Func <Task <int> > unnamedResult = async() => { await Task.Delay(1000); return(1); }; Console.WriteLine($"Unnamed Method with result - {await unnamedResult()}"); //4. async event EventStatic += async(sender, args) => { await Task.Delay(1000); Console.WriteLine("Event"); }; EventStatic(null, null); EventStatic.Invoke(null, null); Console.ReadKey(); }
public void Complete() { EventStatic.OnLoadComplete(message); }
public Track(string message) { this.message = message; EventStatic.OnLoadStart(this.message); }
public Track(string aMessage) { message = aMessage; EventStatic.OnLoadStart(message); }