Esempio n. 1
0
 public HackCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"{CmdName} <node> #<software>";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 2;
 }
Esempio n. 2
0
 public TargetCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"{CmdName} <network>";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 1;
 }
Esempio n. 3
0
 public TestCommand(IDexPromise promise) : base(promise)
 {
     OptionalParamCount  = 0;
     MandatoryParamCount = 0;
     CommandName         = CmdName;
     CommandHelpString   = "login";
     State = CommandState.NotStarted;
 }
Esempio n. 4
0
 public InitCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"{CmdName} <login> <pwd> [realm]";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 2;
     OptionalParamCount  = 1;
 }
Esempio n. 5
0
 public WelcomeCommand(string text, Verbosity verbosity, IDexPromise promise) : base(promise)
 {
     CommandName       = CmdName;
     CommandHelpString = $"{CmdName}";
     _text             = text;
     _verbosity        = verbosity;
     State             = CommandState.NotStarted;
 }
Esempio n. 6
0
 public LoginCommand(IDexPromise promise) : base(promise)
 {
     OptionalParamCount  = 1;
     MandatoryParamCount = 1;
     CommandName         = CmdName;
     CommandHelpString   = "login <user> [password]";
     State = CommandState.NotStarted;
 }
Esempio n. 7
0
 public MacroCommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = $"<command>[newline][command][newline][command]";
     State               = CommandState.NotStarted;
     CommandName         = CmdName.ToLower();
     MandatoryParamCount = 0;
     OptionalParamCount  = 0;
 }
Esempio n. 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" }
            };
        }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 11
0
 protected CommandBase(IDexPromise promise)
 {
     Promise = promise;
 }
Esempio n. 12
0
 public ShowGraphUICommand(IDexPromise promise) : base(promise)
 {
     CommandHelpString   = "info #<software code>";
     MandatoryParamCount = 0;
 }
Esempio n. 13
0
 public DexInfoInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "info #<software code>";
     MandatoryParamCount = 1;
     OptionalParamCount  = 2;
 }
Esempio n. 14
0
 public SRStatusInstructionCommand(Commands.Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = $"{CmdName}";
     MandatoryParamCount = 0;
     OptionalParamCount  = 0;
 }
Esempio n. 15
0
 public DexLookInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "look <node>";
     MandatoryParamCount = 1;
 }
Esempio n. 16
0
 //should _commands init _commands in the derived class :(
 protected CompositeCommand(IDexPromise promise) : base(promise)
 {
 }
Esempio n. 17
0
 public DexDirectInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "!<any text>";
     MandatoryParamCount = 0;
 }
Esempio n. 18
0
 protected SRInstructionCommandBase(string instruction, Verbosity verbosity, IDexPromise promise) : base(promise)
 {
     _instruction = instruction;
     Verbosity    = verbosity;
     State        = CommandState.NotStarted;
 }
Esempio n. 19
0
 public DexTargetInstructionCommand(Verbosity verbosity, IDexPromise promise) : base(CmdName, verbosity, promise)
 {
     CommandHelpString   = "target <networkName>  //i.e target Blackmirror11";
     MandatoryParamCount = 1;
     OptionalParamCount  = 0;
 }
Esempio n. 20
0
 protected TextOutBase(IDexPromise promise) : base(promise)
 {
 }