ACAT.Extensions.Default.FunctionalAgents.NewFile.NewFileAgent.handleQuit C# (CSharp) Méthode

handleQuit() private méthode

Handle quit by asking the user if there is a need to ask. Close forms
private handleQuit ( bool showPrompt = true ) : void
showPrompt bool Should we prompt the user?
Résultat void
        private void handleQuit(bool showPrompt = true)
        {
            bool confirmQuit = true;
            if (showPrompt)
            {
                confirmQuit = confirm(Resources.ExitWithoutCreating);
                if (confirmQuit)
                {
                    ExitCode = CompletionCode.None;
                }
            }

            if (confirmQuit)
            {
                if (_newFileNameForm != null)
                {
                    _newFileNameForm.EvtDone -= _newFileNameForm_EvtDone;
                    Windows.CloseForm(_newFileNameForm);
                }

                _fileChoiceMenu = null;
                _scannerShown = false;
                CreateTextFile = false;
                CreateWordDoc = false;

                Close();
            }
        }