private void OnStateWaitingForInput(State state) { if (SyncContext != null && SyncContext.InvokeRequired) { SyncContext.BeginInvoke(new Procedure <State>(OnStateWaitingForInput), new object[] { state }); } else { StateWaitingForInput?.Invoke(this, new EventArgs <State>(state)); } }
private void OnStateMachineFinished() { if (SyncContext != null && SyncContext.InvokeRequired) { SyncContext.BeginInvoke(new Procedure(OnStateMachineFinished), null); } else { StateMachineFinished?.Invoke(this, EventArgs.Empty); } }
private void OnStateProgress(double percent) { if (SyncContext != null && SyncContext.InvokeRequired) { SyncContext.BeginInvoke(new Procedure <double>(OnStateProgress), new object[] { percent }); } else { StateProgress?.Invoke(this, new ProgressEventArgs(percent)); } }