Пример #1
0
 /// <summary>
 /// 取消注册监听
 /// </summary>
 /// <param name="requestID">请求ID</param>
 /// <param name="callBack">回调函数</param>
 public virtual void UnRegisterListener(int requestID, ListenerMessageCallBack callBack)
 {
     lock (m_listeners)
     {
         if (m_listeners.ContainsKey(requestID))
         {
             m_listeners[requestID].Remove(callBack);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// 创建登录窗体
 /// </summary>
 /// <param name="native">方法库</param>
 public LoginWindow(INativeBase native)
 {
     Load(native, "LoginWindow", "windowLogin");
     m_invokeEvent = new ControlInvokeEvent(Invoke);
     m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
     //注册点击事件
     RegisterEvents(m_window);
     m_loginService           = DataCenter.LoginService;
     m_loginDataCallBackEvent = new ListenerMessageCallBack(LoginDataCallBack);
     m_loginService.RegisterListener(m_loginRequestID, m_loginDataCallBackEvent);
 }
Пример #3
0
 /// <summary>
 /// 创建聊天窗体
 /// </summary>
 /// <param name="native">方法库</param>
 public ChatWindow(INativeBase native)
 {
     Load(native, "ChatWindow", "windowChat");
     m_invokeEvent = new ControlInvokeEvent(Invoke);
     m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
     //注册点击事件
     RegisterEvents(m_window);
     m_chatService           = DataCenter.ChatService;
     m_chatDataCallBackEvent = new ListenerMessageCallBack(ChatDataCallBack);
     m_chatService.RegisterListener(m_chatService.RequestID, m_chatDataCallBackEvent);
 }
Пример #4
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         if (m_gridCategory != null)
         {
             m_gridCategory.UnRegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
             m_gridSelectedRowsChangedEvent = null;
             m_gridCategory.UnRegisterEvent(m_gridCellEditEndEvent, EVENTID.GRIDCELLEDITEND);
             m_gridCellEditEndEvent = null;
             m_gridCategory         = null;
         }
         if (m_gridSecurities != null)
         {
             m_gridSecurities.UnRegisterEvent(m_gridCellClick, EVENTID.GRIDCELLCLICK);
             m_gridCellClick  = null;
             m_gridSecurities = null;
         }
         if (m_quoteService != null)
         {
             m_quoteService.UnRegisterListener(m_latestDataRequestID, m_latestDataCallBack);
             m_latestDataCallBack = null;
             m_quoteService       = null;
         }
         m_latestDatas.Clear();
         if (m_txtSearch != null)
         {
             m_txtSearch.UnRegisterEvent(m_searchTextBoxGotFocus, EVENTID.GOTFOCUS);
             m_searchTextBoxGotFocus = null;
             m_txtSearch             = null;
         }
         if (m_userSecurityService != null)
         {
             m_userSecurityService.UnRegisterListener(m_userSecurityService.OperatorRequestID, m_userSecurityDataCallBack);
             m_userSecurityDataCallBack = null;
             m_userSecurityService      = null;
         }
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_invokeEvent, EVENTID.INVOKE);
             m_invokeEvent = null;
             m_window.UnRegisterEvent(m_timerEvent, EVENTID.TIMER);
             m_timerEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }
Пример #5
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         if (m_chatService != null)
         {
             if (m_chatDataCallBackEvent != null)
             {
                 m_chatService.UnRegisterListener(m_chatService.RequestID, m_chatDataCallBackEvent);
                 m_chatDataCallBackEvent = null;
             }
             m_chatService = null;
         }
         base.Dispose();
     }
 }
Пример #6
0
 /// <summary>
 /// 注册数据监听
 /// </summary>
 /// <param name="requestID">请求ID</param>
 /// <param name="callBack">回调函数</param>
 public virtual void registerListener(int requestID, ListenerMessageCallBack callBack)
 {
     lock (m_listeners) {
         FCMessageListener listener = null;
         if (!m_listeners.ContainsKey(requestID))
         {
             listener = new FCMessageListener();
             m_listeners.put(requestID, listener);
         }
         else
         {
             listener = m_listeners.get(requestID);
         }
         listener.add(callBack);
     }
 }
Пример #7
0
        /// <summary>
        /// 创建登录窗体
        /// </summary>
        /// <param name="native">方法库</param>
        public LoginWindow(INativeBase native)
        {
            m_native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\LoginWindow.xml";

            Native = m_native;
            LoadFile(xmlPath, null);
            m_window      = FindControl("windowLogin") as WindowEx;
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册点击事件
            RegisterEvents(m_window);
            m_loginService           = DataCenter.LoginService;
            m_loginDataCallBackEvent = new ListenerMessageCallBack(LoginDataCallBack);
            m_loginService.RegisterListener(m_loginRequestID, m_loginDataCallBackEvent);
        }
Пример #8
0
 /// <summary>
 /// 注册数据监听
 /// </summary>
 /// <param name="requestID">请求ID</param>
 /// <param name="callBack">回调函数</param>
 public virtual void RegisterListener(int requestID, ListenerMessageCallBack callBack)
 {
     lock (m_listeners)
     {
         MessageListener listener = null;
         if (!m_listeners.ContainsKey(requestID))
         {
             listener = new MessageListener();
             m_listeners[requestID] = listener;
         }
         else
         {
             listener = m_listeners[requestID];
         }
         listener.Add(callBack);
     }
 }
Пример #9
0
 /// <summary>
 /// 添加控件方法
 /// </summary>
 public override void OnAdd()
 {
     base.OnAdd();
     if (m_securityService == null)
     {
         //注册服务
         m_securityService          = DataCenter.SecurityService;
         m_userSecurityService      = DataCenter.UserSecurityService;
         m_userSecurityDataCallBack = new ListenerMessageCallBack(UserSecurityDataCallBack);
         m_userSecurityService.RegisterListener(m_userSecurityService.GetListRequestID, m_userSecurityDataCallBack);
         m_userSecurityService.RegisterListener(m_userSecurityService.OperatorRequestID, m_userSecurityDataCallBack);
         //注册行情
         m_quoteService       = DataCenter.QuoteService;
         m_latestDataCallBack = new ListenerMessageCallBack(LatestDataCallBack);
         m_quoteService.RegisterListener(m_latestDataRequestID, m_latestDataCallBack);
         StartTimer(m_timerID, 10);
     }
 }
Пример #10
0
        /// <summary>
        /// 创建条件选股界面
        /// </summary>
        /// <param name="native">方法库</param>
        public IndicatorLayoutList(INativeBase native)
        {
            m_native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\IndicatorLayoutList.xml";

            Native = m_native;
            LoadFile(xmlPath, null);
            m_window      = FindControl("windowILL") as WindowEx;
            m_gridLayouts = GetGrid("gridLayouts");
            m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged);
            m_gridLayouts.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册点击事件
            RegisterEvents(m_window);
            m_indicatorLayoutService      = DataCenter.IndicatorLayoutService;
            m_indicatorLayoutDataCallBack = new ListenerMessageCallBack(IndicatorLayoutDataCallBack);
            m_indicatorLayoutService.RegisterListener(m_indicatorLayoutService.OperatorRequestID, m_indicatorLayoutDataCallBack);
        }
Пример #11
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         if (m_quoteService != null)
         {
             m_quoteService.UnRegisterListener(m_latestDataRequestID, m_latestDataCallBack);
             m_latestDataCallBack = null;
             m_quoteService       = null;
         }
         m_latestDatas.Clear();
         if (m_userSecurityService != null)
         {
             m_userSecurityService.UnRegisterListener(m_userSecurityService.OperatorRequestID, m_userSecurityDataCallBack);
             m_userSecurityDataCallBack = null;
             m_userSecurityService      = null;
         }
         base.Dispose();
     }
 }
Пример #12
0
        /// <summary>
        /// 创建条件选股界面
        /// </summary>
        /// <param name="native">方法库</param>
        public SecurityFilterList(INativeBase native)
        {
            m_native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\SecurityFilterList.xml";

            Native = m_native;
            LoadFile(xmlPath, null);
            m_window       = FindControl("windowSF") as WindowEx;
            m_gridTemplate = GetGrid("gridTemplates");
            m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged);
            m_gridTemplate.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册秒表
            m_timerEvent = new ControlTimerEvent(CallTimer);
            m_window.RegisterEvent(m_timerEvent, EVENTID.TIMER);
            //注册点击事件
            RegisterEvents(m_window);
            m_securityService                 = DataCenter.SecurityService;
            m_securityFilterService           = DataCenter.SecurityFilterService;
            m_securityFilterDataCallBackEvent = new ListenerMessageCallBack(SecurityFilterDataCallBack);
            m_securityFilterService.RegisterListener(m_securityFilterService.OperatorRequestID, m_securityFilterDataCallBackEvent);
        }
Пример #13
0
        /// <summary>
        /// 创建股票列表窗体
        /// </summary>
        /// <param name="native">方法库</param>
        public SecurityList(INativeBase native)
        {
            m_native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\SecurityList.xml";

            Native = m_native;
            LoadFile(xmlPath, null);
            m_window      = FindControl("windowSecurity") as WindowEx;
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册点击事件
            RegisterEvents(m_window);
            m_gridSecurities       = GetGrid("gridSecurities");
            m_gridSelectSecurities = GetGrid("gridSelectSecurities");
            m_tvBlock = GetTree("tvBlock");
            m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged);
            m_tvBlock.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
            //注册服务
            m_securityService      = DataCenter.SecurityService;
            m_securityDataCallBack = new ListenerMessageCallBack(SecurityDataCallBack);
            m_securityService.RegisterListener(m_securitiesRequestID, m_securityDataCallBack);
            m_userSecurityService = DataCenter.UserSecurityService;
        }
Пример #14
0
        /// <summary>
        /// 创建自选股界面
        /// </summary>
        /// <param name="native">方法库</param>
        public UserSecurityList(INativeBase native)
        {
            m_native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\UserSecurityList.xml";

            Native = m_native;
            LoadFile(xmlPath, null);
            m_window      = FindControl("windowUS") as WindowEx;
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册秒表
            m_timerEvent = new ControlTimerEvent(CallTimer);
            m_window.RegisterEvent(m_timerEvent, EVENTID.TIMER);
            //注册点击事件
            RegisterEvents(m_window);
            m_gridCategory = GetGrid("gridCategory");
            m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged);
            m_gridCategory.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
            m_gridCellEditEndEvent = new GridCellEvent(CategoryGridCellEditEnd);
            m_gridCategory.RegisterEvent(m_gridCellEditEndEvent, EVENTID.GRIDCELLEDITEND);
            m_gridSecurities = GetGrid("gridSecurities");
            m_gridCellClick  = new GridCellMouseEvent(GridCellClick);
            m_gridSecurities.RegisterEvent(m_gridCellClick, EVENTID.GRIDCELLCLICK);
            //注册服务
            m_securityService          = DataCenter.SecurityService;
            m_userSecurityService      = DataCenter.UserSecurityService;
            m_userSecurityDataCallBack = new ListenerMessageCallBack(UserSecurityDataCallBack);
            m_userSecurityService.RegisterListener(m_userSecurityService.OperatorRequestID, m_userSecurityDataCallBack);
            //注册行情
            m_quoteService       = DataCenter.QuoteService;
            m_latestDataCallBack = new ListenerMessageCallBack(LatestDataCallBack);
            m_quoteService.RegisterListener(m_latestDataRequestID, m_latestDataCallBack);
            //搜索文本框
            m_txtSearch             = GetTextBox("txtSearch");
            m_searchTextBoxGotFocus = new ControlEvent(SearchTextBoxGotFocus);
            m_txtSearch.RegisterEvent(m_searchTextBoxGotFocus, EVENTID.GOTFOCUS);
        }
Пример #15
0
        /// <summary>
        /// 创建宏管理界面
        /// </summary>
        /// <param name="native">方法库</param>
        public MacroList(INativeBase native)
        {
            m_native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\MacroList.xml";

            Native = m_native;
            LoadFile(xmlPath, null);
            m_window  = FindControl("windowMacro") as WindowEx;
            m_divIcon = GetDiv("divIcon");
            m_divIcon.ResourcePath = DataCenter.GetAppPath() + "\\config\\icons\\";
            m_gridIcons            = GetGrid("gridIcons");
            m_gridCellClickEvent   = new GridCellMouseEvent(GridCellClick);
            m_gridIcons.RegisterEvent(m_gridCellClickEvent, EVENTID.GRIDCELLCLICK);
            m_gridMacros = GetGrid("gridMacros");
            m_gridSelectedRowsChangedEvent = new ControlEvent(GridSelectedRowsChanged);
            m_gridMacros.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册点击事件
            RegisterEvents(m_window);
            m_macroService      = DataCenter.MacroService;
            m_macroDataCallBack = new ListenerMessageCallBack(MacroDataCallBack);
            m_macroService.RegisterListener(m_macroService.OperatorRequestID, m_macroDataCallBack);
        }
Пример #16
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         if (m_loginService != null)
         {
             if (m_loginDataCallBackEvent != null)
             {
                 m_loginService.UnRegisterListener(m_loginRequestID, m_loginDataCallBackEvent);
                 m_loginDataCallBackEvent = null;
             }
             m_loginService = null;
         }
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_invokeEvent, EVENTID.INVOKE);
             m_invokeEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }
Пример #17
0
 /// <summary>
 /// 移除回调
 /// </summary>
 /// <param name="callBack">回调</param>
 public void Remove(ListenerMessageCallBack callBack)
 {
     m_callBacks.Remove(callBack);
 }
Пример #18
0
 /// <summary>
 /// 添加回调
 /// </summary>
 /// <param name="callBack">回调</param>
 public void Add(ListenerMessageCallBack callBack)
 {
     m_callBacks.Add(callBack);
 }