Example #1
0
        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();
        }
Example #2
0
 public void Complete()
 {
     EventStatic.OnLoadComplete(message);
 }
Example #3
0
 public Track(string message)
 {
     this.message = message;
     EventStatic.OnLoadStart(this.message);
 }
Example #4
0
 public Track(string aMessage)
 {
     message = aMessage;
     EventStatic.OnLoadStart(message);
 }