예제 #1
0
        /// <summary>
        /// The main constructor
        /// </summary>
        /// <param name="ARuntimeAction">Action to perform</param>
        /// <param name="APort">Port number to act on, where relevant</param>
        public ImmediateExecuteForm(ImmediateActions ARuntimeAction, int APort)
        {
            InitializeComponent();

            _runtimeAction = ARuntimeAction;
            _port          = APort;
        }
예제 #2
0
        /// <summary>
        /// The main constructor
        /// </summary>
        /// <param name="ARuntimeAction">Action to perform</param>
        /// <param name="APort">Port number to act on, where relevant</param>
        public ImmediateExecuteForm(ImmediateActions ARuntimeAction, int APort)
        {
            InitializeComponent();

            _runtimeAction = ARuntimeAction;
            _port = APort;
        }
예제 #3
0
        /// <summary>
        /// Parses the command line arguments
        /// </summary>
        /// <param name="args">The array of arguments passed to the main application program</param>
        public void ParseCommandLine(string[] args)
        {
            foreach (string arg in args)
            {
                if (arg.StartsWith("-op:"))
                {
                    string command = arg.Substring(4).Trim().ToLower();

                    switch (command)
                    {
                    case "shutdownall":
                        _immediateAction = ImmediateActions.ShutdownAll;
                        break;

                    case "shutdown":
                        _immediateAction = ImmediateActions.Shutdown;
                        break;

                    case "start":
                        _immediateAction = ImmediateActions.Start;
                        break;

                    case "stop":
                        _immediateAction = ImmediateActions.Stop;
                        break;
                    }
                }
                else if (arg.StartsWith("-port:"))
                {
                    int port;

                    if (Int32.TryParse(arg.Substring(6), out port))
                    {
                        _port = port;
                    }
                }
            }

            _executeImmediateAction = IsValid;
        }
예제 #4
0
        /// <summary>
        /// Parses the command line arguments
        /// </summary>
        /// <param name="args">The array of arguments passed to the main application program</param>
        public void ParseCommandLine(string[] args)
        {
            foreach (string arg in args)
            {
                if (arg.StartsWith("-op:"))
                {
                    string command = arg.Substring(4).Trim().ToLower();

                    switch (command)
                    {
                        case "shutdownall":
                            _immediateAction = ImmediateActions.ShutdownAll;
                            break;

                        case "shutdown":
                            _immediateAction = ImmediateActions.Shutdown;
                            break;

                        case "start":
                            _immediateAction = ImmediateActions.Start;
                            break;

                        case "stop":
                            _immediateAction = ImmediateActions.Stop;
                            break;
                    }
                }
                else if (arg.StartsWith("-port:"))
                {
                    int port;

                    if (Int32.TryParse(arg.Substring(6), out port))
                    {
                        _port = port;
                    }
                }
            }

            _executeImmediateAction = IsValid;
        }