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

Activate() public méthode

Invoked when the Functional agent is activated. This is the entry point into this agent.
public Activate ( ) : bool
Résultat bool
        public override bool Activate()
        {
            ExitCode = CompletionCode.ContextSwitch;

            if (CreateTextFile)
            {
                showNewFileDialogForTextFile();
            }
            else if (CreateWordDoc)
            {
                showNewFileDialogForWordDoc();
            }
            else
            {
                var choice = showFileChoices();
                switch (choice)
                {
                    case "TextFile":
                        if (checkValidOrCreate(Common.AppPreferences.NewTextFileCreateFolder))
                        {
                            showNewFileDialogForTextFile();
                        }
                        break;

                    case "WordDoc":
                        if (checkValidOrCreate(Common.AppPreferences.NewWordDocCreateFolder))
                        {
                            showNewFileDialogForWordDoc();
                        }
                        break;

                    default:
                        ExitCode = CompletionCode.None;
                        handleQuit(false);
                        break;
                }
            }

            return true;
        }