Example #1
0
 private void OnWorkPerformed(object sender, WorkPerformedEventArgs e)
 {
     if (WorkPerformed != null)
     {
         WorkPerformed(sender, e);
     }
 }
Example #2
0
        public virtual void DoWork(int hours, WorkType workType)
        {
            //Do work here

            //Notify class consumer that work has been performed
            //Create eventargs
            WorkPerformedEventArgs e = new WorkPerformedEventArgs();

            e.Hours    = hours;
            e.WorkType = workType;
            OnWorkPerformed(this, e);
        }
 public static void Manager_WorkPerformed(object sender,
                                          WorkPerformedEventArgs e)
 {
     Console.WriteLine("WorkPerformed event fired.  Hours: {0}  WorkType: {1}",
                       e.Hours.ToString(), e.WorkType.ToString());
 }