Пример #1
0
 public HackCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"{CmdName} <node> #<software>";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 2;
 }
Пример #2
0
 public TargetCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"{CmdName} <network>";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 1;
 }
Пример #3
0
 public TestCommand(IDexPromise promise) : base(promise)
 {
     OptionalParamCount  = 0;
     MandatoryParamCount = 0;
     CommandName         = CmdName;
     CommandHelpString   = "login";
     State = CommandState.NotStarted;
 }
Пример #4
0
 public InitCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"{CmdName} <login> <pwd> [realm]";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 2;
     OptionalParamCount  = 1;
 }
Пример #5
0
 public WelcomeCommand(string text, Verbosity verbosity, IDexPromise promise) : base(promise)
 {
     CommandName       = CmdName;
     CommandHelpString = $"{CmdName}";
     _text             = text;
     _verbosity        = verbosity;
     State             = CommandState.NotStarted;
 }
Пример #6
0
 public LoginCommand(IDexPromise promise) : base(promise)
 {
     OptionalParamCount  = 1;
     MandatoryParamCount = 1;
     CommandName         = CmdName;
     CommandHelpString   = "login <user> [password]";
     State = CommandState.NotStarted;
 }
Пример #7
0
 public MacroCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"<command>[newline][command][newline][command]";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 0;
     OptionalParamCount  = 0;
 }
Пример #8
0
        public LoginCommand(IDexPromise promise) : base(promise)
        {
            OptionalParamCount  = 1;
            MandatoryParamCount = 2;
            CommandName         = CmdName;
            CommandHelpString   = "login <user> <password> [realm->local]";
            State = CommandState.NotStarted;

            _wellknownNames = new Dictionary <string, string> {
                { "gr8b", "639924" }
            };
        }
Пример #9
0
        public CommandBase ResolveCommand(string input, IDexPromise dexPromise)
        {
            string[] split = input.Split(' ');

            if (LoginCommand.CmdName.Equals(split[0].Trim().ToLower()))
            {
                return(new LoginCommand(dexPromise));
            }
            if (TestCommand.CmdName.Equals(split[0].Trim().ToLower()))
            {
                return(new TestCommand(dexPromise));
            }
            else
            {
                return(new SRDirectInstructionCommand(Verbosity.Critical, dexPromise));
            }

            /*
             * if (input.Contains("\n"))
             *  return new MacroCommand(dexPromise);
             *
             * if (InitCommand.CmdName.Equals(split[0].ToLower()))
             *  return new InitCommand(dexPromise);
             *
             * if (SRStatusInstructionCommand.CmdName.Equals(split[0].ToLower()))
             *  return new SRStatusInstructionCommand(Verbosity.Critical, dexPromise);
             *
             *
             *
             * if (DexInfoInstructionCommand.CmdName.Equals(split[0].ToLower()))
             *  return new DexInfoInstructionCommand(Verbosity.Critical, dexPromise);
             *
             * if (DexTargetInstructionCommand.CmdName.Equals(split[0].ToLower()))
             *  return new DexTargetInstructionCommand(Verbosity.Critical, dexPromise);
             *
             * if (TargetCommand.CmdName.Equals(split[0].ToLower()))
             *  return new TargetCommand(dexPromise);
             *
             * if (DexLookInstructionCommand.CmdName.Equals(split[0].ToLower()))
             *  return new DexLookInstructionCommand(Verbosity.Critical, dexPromise);
             *
             * if (HackCommand.CmdName.Equals(split[0].ToLower()))
             *  return new HackCommand(dexPromise);
             *
             * if (ShowGraphUICommand.CmdName.Equals(split[0].ToLower()))
             *  return new ShowGraphUICommand(dexPromise);
             *
             * if (split[0].ToLower().StartsWith("#"))
             *  return new DexHackInstructionCommand(Verbosity.Critical, dexPromise);*/


            return(null);
        }
Пример #10
0
        public void SetPromise(IDexPromise promise)
        {
            MainWindow view = new MainWindow();

            MainWindowViewModel viewModel = new MainWindowViewModel();

            promise.Network.Nodes["VPN1"].Disabled = 700;

            viewModel.SetNetwork(promise.Network);

            view.DataContext = viewModel;
            if (elementHost1.Child != null)
            {
                elementHost1.Child = null;
            }

            elementHost1.Child = view;
        }
Пример #11
0
 protected CommandBase(IDexPromise promise)
 {
     Promise = promise;
 }
Пример #12
0
 public ShowGraphUICommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = "info #<software code>";
     MandatoryParamCount = 0;
 }
Пример #13
0
 public DexInfoInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "info #<software code>";
     MandatoryParamCount = 1;
     OptionalParamCount  = 2;
 }
Пример #14
0
 public SRStatusInstructionCommand(Commands.Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = $"{CmdName}";
     MandatoryParamCount = 0;
     OptionalParamCount  = 0;
 }
Пример #15
0
 public DexLookInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "look <node>";
     MandatoryParamCount = 1;
 }
Пример #16
0
 //should _commands init _commands in the derived class :(
 protected CompositeCommand(IDexPromise promise) : base(promise)
 {
 }
Пример #17
0
 public DexDirectInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "!<any text>";
     MandatoryParamCount = 0;
 }
Пример #18
0
 protected SRInstructionCommandBase(string instruction, Verbosity verbosity, IDexPromise promise) : base(promise)
 {
     _instruction = instruction;
     Verbosity    = verbosity;
     State        = CommandState.NotStarted;
 }
Пример #19
0
 public DexTargetInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "target <networkName>  //i.e target Blackmirror11";
     MandatoryParamCount = 1;
     OptionalParamCount  = 0;
 }
Пример #20
0
 protected TextOutBase(IDexPromise promise) : base(promise)
 {
 }