예제 #1
0
        private void MainDialog_Load(object sender, EventArgs e)
        {
            DialogLogin loginDlg = new DialogLogin();

            loginDlg.SettingConfigs = m_SettingConfigs;

            if (loginDlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                Environment.Exit(0);
            }
            this.Text = getCaption(loginDlg.apiSection.ApiElement.AppID);
            if (m_StockConfigs.load())
            {
                foreach (KeyValuePair <string, string> kvce in m_StockConfigs.appConfigs)
                {
                    SmpStock stock = new SmpStock(kvce.Key, kvce.Value);
                    stock.Checked = true;
                    lst_Stocks.Add(stock);
                }
            }
            if (m_NewsConfigs.load())
            {
                foreach (KeyValuePair <string, string> kvce in m_NewsConfigs.appConfigs)
                {
                    Links theNews = new Links(kvce.Key, kvce.Value);
                    lst_News.Add(theNews);
                }
            }
            m_NewsPanel = new NewsPanel(lst_News);
            TabPage_News.Controls.Add(m_NewsPanel);

            m_StockPanel.InitData(lst_Stocks);

            m_UpdateTimer.Interval = 1000;
            m_UpdateTimer.Enabled  = true;
            m_UpdateTimer.Tick    += new EventHandler(UpdateTimer_Tick_EventHandler);
            m_UpdateTimer.Start();

            m_SecondTimer.Interval = 1000;
            m_SecondTimer.Enabled  = true;
            m_SecondTimer.Tick    += new EventHandler(SecondTimer_Tick_EventHandler);
            m_SecondTimer.Start();

            CfgManager.ReadConnectionStrings();
            CfgManager.MapMachineConfiguration();
            SNTPTime.calibrationTime();

            m_HandleShowApi.BgWorkerCompleted += new EventHandler <BgWorkerEventArgs>(HandleShowApi_BgWorkerCompleted);
        }