void OnStateComplete(object sender, EventArgs e) { WorkerState state = sender as WorkerState; if (null != state) { state.StateComplete -= OnStateComplete; } state = StateFactory(state); if (null != state) { ExecuteState(state); } }
abstract public WorkerState StateFactory(WorkerState args = null);