Beispiel #1
0
        public static void Init(FrmMain uiform)
        {
            //Init Thread Name
            Thread.CurrentThread.Name = "UI";

            //Init WebBrowser Pool
            CWBPool.Init(uiform);

            //Init PerformanceBalancer
            PerformanceBalancer.Init(false);

            //Init FetionTimer
            uiform.timerMain.Enabled = true;

            //Init TaskManager & TaskTransmissionManager
            ms_FetionSendingTime = new Dictionary <int, bool>();
            for (int i = 0; i < 24; i++)
            {
                ms_FetionSendingTime.Add(i, false);
            }
            LoadManagerFromFile(uiform);
            m_tms.TaskTransmissionManager = m_ttm;
            m_ttm.TaskManagerServer       = m_tms;

            //open tcp server
            try
            {
                ConnectionManagerServer.RegisterTcpChannel(ms_socketport);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message + Environment.NewLine + "请重新配置端口号", "注册端口错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                log.Error("注册端口错误: ", e);
            }

            //Test Log DB
            string errmessage = null;

            if (LogDatabaseManager.TestConnection(ref errmessage) == false)
            {
                MessageBox.Show(errmessage, "日志数据库", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //Start Tcp Service
            string errormessage = null;

            if (!ConnectionManagerServer.StartTcpServer(m_ttm, ref errormessage))
            {
                MessageBox.Show(errormessage, "启动服务错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
        public static void Init(FrmMain uiform)
        {
            Thread.CurrentThread.Name = "UI";
            ms_ui = uiform;

            //Init PerformanceBalancer
            PerformanceBalancer.Init(true);

            //Init Web Browser Warehouse
            log.Info("Init Web Browser Pool...");
            CWBPool.Init(ms_ui);

            //Init Channel
            RegisterTcpChannelForClient();

            //Init TaskManager & TaskTransmissionManager
            LoadManagerFromFile(uiform);
        }