Esempio n. 1
0
        public bool Init(FormAutoModeClient refView, string[] args)
        {
            m_refView = refView;

            string strErrMessage;

            if (CheckArgs(args, out strErrMessage) == false)
            {
                FileLog.Instance.Write(strErrMessage);
                return(false);
            }

            m_netClient     = new NetClient();
            m_commandSender = new CommandSender(m_netClient);
            m_netClient.SetCommandHandler(new CommandHandler_AutoMode(this, m_commandSender));

            m_eMode = GetAutoModeByString(args[0]);
            if (m_eMode == AUTO_MODE_TYPE.JUST_START)
            {
                m_strTargetServerName = args[1];
            }
            else if (m_eMode == AUTO_MODE_TYPE.JUST_STOP)
            {
                m_strTargetServerName = args[1];
            }

            return(true);
        }
Esempio n. 2
0
        private static FormAutoModeClient CreateAutoModeClient(string[] args)
        {
            AutoModeClient     autoModeClient     = new AutoModeClient();
            FormAutoModeClient formAutoModeClient = new FormAutoModeClient(autoModeClient);

            if (autoModeClient.Init(formAutoModeClient, args) == false)
            {
                return(null);
            }

            if (autoModeClient.StartAutoMode() == false)
            {
                return(null);
            }

            return(formAutoModeClient);
        }