public static void Register(ICommandManager cm)
        {
            _terminalEdit   = new CommandCategory("CommandCategory.TerminalEdit");
            _terminal       = new CommandCategory("CommandCategory.Terminal").SetPosition(PositionType.NextTo, _terminalEdit);
            _hiddenTerminal = new CommandCategory("", false);

            //以下、編集メニュー内にあるもの
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.copyaslook",
                                            "Command.CopyAsLook", _terminalEdit, new ExecuteDelegate(CmdCopyAsLook), DoesExistSelection));
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.copytofile",
                                            "Command.CopyToFile", _terminalEdit, new ExecuteDelegate(CmdCopyToFile), DoesExistSelection));
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.pastefromfile",
                                            "Command.PasteFromFile", _terminalEdit, new ExecuteDelegate(CmdPasteFromFile), DoesOpenTargetSession));

            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.clearbuffer",
                                            "Command.ClearBuffer", _terminalEdit, new ExecuteDelegate(CmdClearBuffer), TerminalCommand.DoesExistTargetSession));
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.clearscreen",
                                            "Command.ClearScreen", _terminalEdit, new ExecuteDelegate(CmdClearScreen), TerminalCommand.DoesExistTargetSession));

            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.selectall",
                                            "Command.SelectAll", _terminalEdit, new ExecuteDelegate(CmdSelectAll), TerminalCommand.DoesExistCharacterDocumentViewer));

            //以下、コンソールメニュー内にあるもの
            //TODO いくつかはTerminalSessionにあるべき意味合いだ
            //cm.Register(new TerminalCommand("org.poderosa.terminalemulator.reproduce", new ExecuteDelegate(CmdReproduce), new EnabledDelegate(DoesOpenTargetSession)));

            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.newline.cr",
                                            "Command.NewLine.CR", _hiddenTerminal, new ExecuteDelegate(CmdNewLineCR), DoesOpenTargetSession));
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.newline.lf",
                                            "Command.NewLine.LF", _hiddenTerminal, new ExecuteDelegate(CmdNewLineLF), DoesOpenTargetSession));
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.newline.crlf",
                                            "Command.NewLine.CRLF", _hiddenTerminal, new ExecuteDelegate(CmdNewLineCRLF), DoesOpenTargetSession));

            foreach (EncodingType enc in Enum.GetValues(typeof(EncodingType)))
            {
                EncodingType encodingType = enc;
                cm.Register(
                    new TerminalCommand("org.poderosa.terminalemulator.encoding." + encodingType.ToString(),
                                        "Command.Encoding." + encodingType.ToString(), _hiddenTerminal,
                                        delegate(ICommandTarget target) { return(CmdEncoding(target, encodingType)); },
                                        DoesOpenTargetSession));
            }

            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.receivelinebreak",
                                            "Command.ReceiveLineBreak", _terminal, new ExecuteDelegate(CmdReceiveLineBreak), DoesOpenTargetSession));

            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.togglelocalecho",
                                            "Command.ToggleLocalEcho", _terminal, new ExecuteDelegate(CmdToggleLocalEcho), DoesOpenTargetSession));


            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.sendbreak",
                                            "Command.SendBreak", _terminal, new ExecuteDelegate(CmdSendBreak), DoesOpenTargetSession));
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.sendAYT",
                                            "Command.AreYouThere", _terminal, new ExecuteDelegate(CmdSendAYT), DoesOpenTargetSession));
            cm.Register(new TerminalCommand("org.poderosa.terminalemulator.resetterminal",
                                            "Command.ResetTerminal", _terminal, new ExecuteDelegate(CmdResetTerminal), DoesOpenTargetSession));

            //IntelliSense
            cm.Register(new ToggleIntelliSenseCommand());
        }
Exemplo n.º 2
0
 public TerminalCommand(string id, string description, CommandCategory category, ExecuteDelegate body, CanExecuteDelegate enabled)
     :
     base(id, GEnv.Strings, description, category, body, enabled)
 {
 }
Exemplo n.º 3
0
 public CommandCategory SetPosition(PositionType positiontype, CommandCategory target)
 {
     _positionType      = positiontype;
     _designationTarget = target;
     return(this);
 }