Exemple #1
0
        public void OnIncMessageCounter(object sender, System.EventArgs e)
        {
            // InvokeRequired required compares the thread ID of the
            // calling thread to the thread ID of the creating thread.
            // If these threads are different, it returns true.
            if (this.rtxtMsgRcv.InvokeRequired)
            {
                OnIncMessageCounterCallback d = new OnIncMessageCounterCallback(OnIncMessageCounter);
                this.Invoke(d, new object[] { sender, e });
            }
            else
            {
                try
                {
                    rtxtMsgRcv.AppendText("Message Received..." + timeStamp(DateTime.Now) + "\n");
                    IList <SummaryData> summaryDataCache = new List <SummaryData>();

                    //Doesn't work...
                    //summaryDataCache = (sender as DataManager.DSManager).GetSummaryDataCache();
                }
                catch (Exception except)
                {
                    throw new Exception("OnIncMessageCounter: " + except.Message);
                }
            }
        }
 public void OnIncMessageCounter(object sender, System.EventArgs e)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.rtxtMsgRcv.InvokeRequired)
     {
         OnIncMessageCounterCallback d = new OnIncMessageCounterCallback(OnIncMessageCounter);
         this.Invoke(d, new object[] { sender, e });
     }
     else
     {
         try
         {
             rtxtMsgRcv.AppendText("Message Received..." + timeStamp(DateTime.Now) + "\n");
             IList<SummaryData> summaryDataCache = new List<SummaryData>();
             
             //Doesn't work...
             //summaryDataCache = (sender as DataManager.DSManager).GetSummaryDataCache();
         }
         catch (Exception except)
         {
             throw new Exception("OnIncMessageCounter: " + except.Message);
         }
     }
 }