private WorktypeViewModel CreateModel(Worktype worktype)
 {
     return(new WorktypeViewModel
     {
         Id = worktype.Id,
         Name = worktype.Name
     });
 }
Exemple #2
0
        public void DoWork(int hours, Worktype worktype)
        {
            for (int i = 0; i < hours; i++)
            {
                // Raise event that work is being performed
                Thread.Sleep(250);
                OnWorkPerformed(i + 1, worktype);
            }

            //Raise event that work has completed
            OnWorkCompleted();
        }
Exemple #3
0
        protected virtual void OnWorkPerformed(int hours, Worktype workType)
        {
            //if( WorkPerformed != null)
            //{
            //    WorkPerformed(hours, worktype);
            //}
            var del = WorkPerformed as EventHandler <WorkPerformedEventArgs>;

            if (del != null)
            {
                del(this, new WorkPerformedEventArgs(hours, workType));
            }
        }
 private Worktype CreateModel(WorktypeBindingModel model, Worktype worktype)
 {
     worktype.Name = model.Name;
     return(worktype);
 }
Exemple #5
0
 public WorkPerformedEventArgs(int hours, Worktype workType)
 {
     Hours    = hours;
     WorkType = workType;
 }
Exemple #6
0
 public static void WorkPerformered(int hours, Worktype worktype)
 {
     Console.WriteLine("WorkPerformed for " + hours + " hours");
 }