コード例 #1
0
        private Dictionary <string, RT_TR> m_mapTR = new Dictionary <string, RT_TR>(); //동일TR+동일코드의 윈도우리스트 관리 < TR+종목코드, RT_TR >

        //리얼데이터 수신
        void SessionPush_OnPushData(ushort wTR, string strCode, string[] arrData)
        {
            //Debug.WriteLine("SessionPush_OnPushData");
            if (IsShutDown)
            {
                return;
            }

            string strBaseKey = string.Format("{0:D3}", wTR);
            string strKey     = strBaseKey + strCode;

            RT_TR pRTTR;

            if (m_mapTR.TryGetValue(strKey, out pRTTR))
            {
                for (int i = 0; i < pRTTR.arrWindow.Count; i++)
                {
                    int    hWnd = pRTTR.arrWindow[i];
                    object dstDataAgent;
                    if (GetValidDataAgent(hWnd, out dstDataAgent))
                    {
                        RTFDataAgent rtfDataAgent = dstDataAgent as RTFDataAgent;
                        if (rtfDataAgent != null)
                        {
                            PushEventArgs args = new PushEventArgs((int)wTR, strCode, arrData);
                            rtfDataAgent.ThreadSafe_PushEvent(SessionPush, args);
                        }
                    }
                }
            }
        }
コード例 #2
0
 public void ThreadSafe_PushEvent(object sender, PushEventArgs e)
 {
     try
     {
         //if (RtfGlobal.MainForm.InvokeRequired)
         // {
         //    ThreadSafe_PushEvent_CallBack d = new ThreadSafe_PushEvent_CallBack(ThreadSafe_PushEvent);
         //    RtfGlobal.MainForm.Invoke(d, new object[] { sender, e });
         //}
         //else
         //{
         if (PushEvent != null)
         {
             PushEvent(this, e);
         }
         //}
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
     finally
     {
     }
 }