コード例 #1
0
ファイル: FileBrowserHandler.cs プロジェクト: zezo010/acat
        /// <summary>
        /// Executes the command
        /// </summary>
        /// <param name="handled">set to true if the command was handled</param>
        /// <returns>true on success</returns>
        public override bool Execute(ref bool handled)
        {
            handled = true;

            if (!Context.AppAgentMgr.CanActivateFunctionalAgent())
            {
                return(false);
            }

            String fileOperation;

            switch (Command)
            {
            case "CmdFileBrowserFileOpen":
                fileOperation = "Open";
                break;

            case "CmdFileBrowserFileDelete":
                fileOperation = "Delete";
                break;

            default:
                fileOperation = "UserChoice";
                break;
            }

            Dispatcher.Scanner.Form.Invoke((MethodInvoker) delegate
            {
                DialogUtils.ShowFileBrowser(fileOperation);
            });

            return(true);
        }