Exemple #1
0
        //Background work process change
        void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (e.ProgressPercentage == 0)
            {
                m_EventArgs = new BgWorkerEventArgs();
            }
            else if (e.ProgressPercentage == 11)
            {
                m_EventArgs.mode = (Int16)(e.UserState);
            }
            else if (e.ProgressPercentage == 12)
            {
                m_EventArgs.codes = (List <String>)e.UserState;
            }
            else if (e.ProgressPercentage == 50)
            {
                m_EventArgs.index = (IndexType)e.UserState;
            }
            else if (e.ProgressPercentage == 99)
            {
                m_EventArgs.timespan = (double)(e.UserState);
            }
            else if (e.ProgressPercentage == 100)
            {
                m_EventArgs.respones = (List <StockType>)e.UserState;
            }

            //Add status message to log
            //statusLogAdd("[MSG] " + e.UserState.ToString());
        }
Exemple #2
0
        protected virtual void OnBgWorkerCompleted(BgWorkerEventArgs e)
        {
            EventHandler <BgWorkerEventArgs> handler = BgWorkerCompleted;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #3
0
 void HandleShowApi_BgWorkerCompleted(object sender, BgWorkerEventArgs e)
 {
     Int16 nCount = 0;
     if (e.index != null)
     {
         IndexPanel_Update(e.index);
     }
     if (true)
     {
         for (System.Collections.IEnumerator ie = e.respones.GetEnumerator(); ie.MoveNext(); )
         {
             if (ie.Current != null)
             {
                 nCount ++;
             }
         }
         m_StockList.UpdateStockData(e.respones);
         m_DealPanel.UpdateStockData(e.respones);
     }
     String spend_time = e.timespan.ToString("N0", CultureInfo.InvariantCulture);
     Console.WriteLine("[INFO] Update [" + nCount + "] spend " + spend_time);
     ToolStripLabel_DateTime.Text = SNTPTime.TrueDateTime.ToString("G", DateTimeFormatInfo.InvariantInfo);
     ToolStripLabel_Time.Text = spend_time;
     m_UpdateTimer.Start();
 }
Exemple #4
0
        //Background work process change
        void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (e.ProgressPercentage == 0)
            {
                m_EventArgs = new BgWorkerEventArgs();
            }
            else if (e.ProgressPercentage == 11)
            {
                m_EventArgs.mode = (Int16)(e.UserState);
            }
            else if (e.ProgressPercentage == 12)
            {
                m_EventArgs.codes = (List<String>)e.UserState;
            }
            else if (e.ProgressPercentage == 50)
            {
                m_EventArgs.index = (IndexType)e.UserState;
            }
            else if (e.ProgressPercentage == 99)
            {
                m_EventArgs.timespan = (double)(e.UserState);
            }
            else if (e.ProgressPercentage == 100)
            {
                m_EventArgs.respones = (List<StockType>)e.UserState;
            }

            //Add status message to log
            //statusLogAdd("[MSG] " + e.UserState.ToString());
        }
Exemple #5
0
 protected virtual void OnBgWorkerCompleted(BgWorkerEventArgs e)
 {
     EventHandler<BgWorkerEventArgs> handler = BgWorkerCompleted;
     if (handler != null)
     {
         handler(this, e);
     }
 }