public void Start(){ if (context == null) { context = new BackgroundLooper (); context.ExceptionThrown += Context_ExceptionThrown; OnExecutionStateChanged (ExecutionState.Executing); context.Start (); } }
public void Stop(){ if (context != null) { OnExecutionStateChanged (ExecutionState.Stopping); context.Resume(); DrainQueuedMethods (); OnExecutionStateChanged (ExecutionState.Stop); context.ExceptionThrown -= Context_ExceptionThrown; context.Dispose(); context = null; } }