private void InitUpdates()
        {
            this.updatesStateMachine = new UpdatesStateMachine();
            this.updatesStateMachine.UIContext = AppWorkspace;

            this.stateMachineExecutor = new StateMachineExecutor(this.updatesStateMachine);
            this.stateMachineExecutor.SyncContext = AppWorkspace;

            this.stateMachineExecutor.StateMachineFinished += OnStateMachineFinished;
            this.stateMachineExecutor.StateBegin += OnStateBegin;
            this.stateMachineExecutor.StateWaitingForInput += OnStateWaitingForInput;
        }
        private void DisposeUpdates()
        {
            if (this.stateMachineExecutor != null)
            {
                this.stateMachineExecutor.StateMachineFinished -= OnStateMachineFinished;
                this.stateMachineExecutor.StateBegin -= OnStateBegin;
                this.stateMachineExecutor.StateWaitingForInput -= OnStateWaitingForInput;
                this.stateMachineExecutor.Dispose();
                this.stateMachineExecutor = null;
            }

            this.updatesStateMachine = null;
        }
Exemple #3
0
        private void CloseButton_Click(object sender, EventArgs e)
        {
            if (this.updatesStateMachine != null)
            {
                this.updatesStateMachine.Abort();
                this.updatesStateMachine = null;
                this.closeButton.Enabled = false;
            }

            Close();
        }