Beispiel #1
0
        public MdUserWrapper(MdUserInfo userInfo)
        {
            InitDelegates();

            MdUserDllWrapper.CreateMdUser(ref userInfo, out m_handler);
            RegisterDelegatesToHandler();
        }
Beispiel #2
0
 public int Disconnect()
 {
     if (m_handler != IntPtr.Zero)
     {
         MdUserDllWrapper.DisconnectMdUser(m_handler);
         m_handler = IntPtr.Zero;
     }
     return(0);
 }
Beispiel #3
0
 private void RegisterDelegatesToHandler()
 {
     if (m_handler != IntPtr.Zero)
     {
         MdUserDllWrapper.RegisterOnFrontConnectedCallback(m_handler, onFrontConnectedDelegate);
         MdUserDllWrapper.RegisterOnFrontDisconnectedCallback(m_handler, onFrontDisconnectedDelegate);
         MdUserDllWrapper.RegisterOnHeartBeatWarningCallback(m_handler, onHeartBeatWarningDelegate);
         MdUserDllWrapper.RegisterOnRspUserLoginCallback(m_handler, onRspUserLoginDelegate);
         MdUserDllWrapper.RegisterOnRspUserLogoutCallback(m_handler, onRspUserLogoutDelegate);
         MdUserDllWrapper.RegisterOnRspErrorCallback(m_handler, onRspErrorDelegate);
         MdUserDllWrapper.RegisterOnRspSubMarketDataCallback(m_handler, onRspSubMarketDataDelegate);
         MdUserDllWrapper.RegisterOnRspUnSubMarketDataCallback(m_handler, onRspUnSubMarketDataDelegate);
         MdUserDllWrapper.RegisterOnRspSubForQuoteRspCallback(m_handler, onRspSubForQuoteRspDelegate);
         MdUserDllWrapper.RegisterOnRspUnSubForQuoteRspCallback(m_handler, onRspUnSubForQuoteRspDelegate);
         MdUserDllWrapper.RegisterOnRtnDepthMarketDataCallback(m_handler, onRtnDepthMarketDataDelegate);
         MdUserDllWrapper.RegisterOnRtnForQuoteRspCallback(m_handler, onRtnForQuoteRspDelegate);
     }
 }
Beispiel #4
0
        protected virtual void Dispose(bool disposing)
        {
            //use called(release managed object)
            if (disposing)
            {
            }
            //Release Unmanaged objects
            if (m_handler != IntPtr.Zero)
            {
                MdUserDllWrapper.DisconnectMdUser(m_handler);
                m_handler = IntPtr.Zero;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }
Beispiel #5
0
 public int Connect()
 {
     return(MdUserDllWrapper.ConnectMdUser(m_handler));
 }
Beispiel #6
0
 public int ReqUserLogout(CThostFtdcUserLogoutField pUserLogout, int nRequestID)
 {
     return(MdUserDllWrapper.ReqUserLogout(m_handler, ref pUserLogout, nRequestID));
 }
Beispiel #7
0
 public int ReqUserLogin(CThostFtdcReqUserLoginField pReqUserLoginField, int nRequestID)
 {
     return(MdUserDllWrapper.ReqUserLogin(m_handler, ref pReqUserLoginField, nRequestID));
 }
Beispiel #8
0
 public int UnSubscribeForQuoteRsp(string[] pReqUserLoginField, int nCount)
 {
     return(MdUserDllWrapper.SubscribeMarketData(m_handler, pReqUserLoginField, nCount));
 }