예제 #1
0
 private void OnWorkPerformed(object sender, WorkPerformedEventArgs workPerformedEventArgs)
 {
     if (WorkPerformed is EventHandler <WorkPerformedEventArgs> del)
     {
         del(sender, workPerformedEventArgs);
     }
 }
예제 #2
0
        private void OnWorkPerformed(object sender, WorkPerformedEventArgs e)
        {
            //if(this.WorkCompleted!=null)
            //    this.WorkPerformed(8, WorkType.GenerateReports);

            //WorkPerformedHandler del = this.WorkPerformed as WorkPerformedHandler;
            //if(del !=null)
            //    del(8, WorkType.GenerateReports);

            this.WorkPerformed?.Invoke(sender, e);
        }
        protected virtual void OnWorkPerformed(int hours, WorkType workType)
        {
            //budas 1
            //if (WorkPerformed!=null)
            //{
            //    WorkPerformed(hours, workType);
            //}

            //budas 2
            //var del = WorkPerformed as WorkPerformedHandler;
            var del = WorkPerformed as EventHandler <WorkPerformedEventArgs>;

            if (del != null)
            {
                var args = new WorkPerformedEventArgs(hours, workType);
                del(this, args);
            }
        }
예제 #4
0
 private static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine($"Working in {e.WorkType} for {e.Hours} hour(s).");
 }
예제 #5
0
 static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs args)
 {
     Console.WriteLine(args.Hours + " - " + args.WorkType);
 }
예제 #6
0
 private static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine($"Hours worked {e.Hours} {e.WorkType}");
 }
 private static void Worker_WorkPerformed2(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine($"tipas {e.WorkType}, Valandos {e.Hours}");
 }
 private static void Worker_WorkPerformed1(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine($"Rasoma is worker_WorkPerformed1. tipas {e.WorkType}, Valandos dirbata: {e.Hours}");
 }
예제 #9
0
 private static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine("Hours worked:{0}, workType:{1}", e.Hours, e.WorkType.ToString());
 }
예제 #10
0
 //static int WorkPerformed3(int hours, WorkType workType)
 //{
 //    Console.WriteLine($"WorkPerformed3 called: {hours}");
 //    return hours + 3;
 //}
 static int WorkPerformed3(object sender, WorkPerformedEventArgs eventArgs)
 {
     Console.WriteLine($"WorkPerformed3 called: {eventArgs.Hours}");
     return(eventArgs.Hours + 3);
 }
예제 #11
0
 static int WorkPerformed3(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine("WorkPermormed3 called " + e.Hours.ToString());
     return(e.Hours + 3);
 }
예제 #12
0
 private static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine(e.Hours + " " + e.WorkType);
 }
예제 #13
0
 public static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine($"Hours worked: {e.Hours}, work type: {e.WorkType}");
 }
예제 #14
0
 public static void EventExample2_WorkPerformed1(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine($"Event Called 1: Worked on {e.WorkType} for {e.Hours}");
 }
예제 #15
0
 public static void worker_WorkPerformed(object sender, WorkPerformedEventArgs e)
 {
     Console.WriteLine("Hours worked: {0}, {1}", e.Hours, e.WorkType);
 }