private WorktypeViewModel CreateModel(Worktype worktype) { return(new WorktypeViewModel { Id = worktype.Id, Name = worktype.Name }); }
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(); }
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); }
public WorkPerformedEventArgs(int hours, Worktype workType) { Hours = hours; WorkType = workType; }
public static void WorkPerformered(int hours, Worktype worktype) { Console.WriteLine("WorkPerformed for " + hours + " hours"); }