// Invoke the Changed event protected virtual void OnChanged(GeneralTaskEventArgs e) { if (Changed != null) { Changed(this, e); } }
private void AddResultToList(GeneralTaskEventArgs args) { outputListBox.Items.Add(String.Format("{0} Result (Worker thread #{1})", _concreteEventArgsToTaskDescription[args.GetType()], args.SourceThreadId)); outputListBox.Items.Add(args.ToString()); }
private void NewResult(object state, GeneralTaskEventArgs args) { if (InvokeRequired) { Invoke(_resultDelegate, new object[] { args }); } else { _resultDelegate(args); } }