private void OnWorkPerformed(object sender, WorkPerformedEventArgs workPerformedEventArgs) { if (WorkPerformed is EventHandler <WorkPerformedEventArgs> del) { del(sender, workPerformedEventArgs); } }
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); } }
private static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e) { Console.WriteLine($"Working in {e.WorkType} for {e.Hours} hour(s)."); }
static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs args) { Console.WriteLine(args.Hours + " - " + args.WorkType); }
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}"); }
private static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e) { Console.WriteLine("Hours worked:{0}, workType:{1}", e.Hours, e.WorkType.ToString()); }
//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); }
static int WorkPerformed3(object sender, WorkPerformedEventArgs e) { Console.WriteLine("WorkPermormed3 called " + e.Hours.ToString()); return(e.Hours + 3); }
private static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e) { Console.WriteLine(e.Hours + " " + e.WorkType); }
public static void Worker_WorkPerformed(object sender, WorkPerformedEventArgs e) { Console.WriteLine($"Hours worked: {e.Hours}, work type: {e.WorkType}"); }
public static void EventExample2_WorkPerformed1(object sender, WorkPerformedEventArgs e) { Console.WriteLine($"Event Called 1: Worked on {e.WorkType} for {e.Hours}"); }
public static void worker_WorkPerformed(object sender, WorkPerformedEventArgs e) { Console.WriteLine("Hours worked: {0}, {1}", e.Hours, e.WorkType); }