public void DoWork(int hours, WorkType type) { for (int i = 0; i < hours; i++) { if (this.WorkPerformed != null) { this.WorkPerformed.Invoke(i + 1, type); } } if (this.WorkComplete != null) { WorkComplete.Invoke(this, new WorkCompletedEventArgs(hours, type)); } }
protected virtual void OnWorkComplete(object sender, EventArgs e) { WorkComplete?.Invoke(sender, e); }
/// <summary> /// Interprocess messege recived handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnIpcCommunicationMessageRecived(object sender, WorkResult e) { m_WorkCommandResults[e.Guid] = e; WorkComplete?.Invoke(this, new WorkCompleteEventArgs(e.Guid)); }