예제 #1
0
        protected virtual void OnStatusChanged(object sender, ConnectionStatus status, RspUserLoginField field)
        {
            Logger.Info(status);
            if (field != null && status == ConnectionStatus.Logined)
            {
                Logger.Info(field.RawErrorID != 0 ? field.RawErrorMsg() : field.DebugInfo());
            }

            switch (status)
            {
            case ConnectionStatus.Done:
                if (field != null)
                {
                    TradingDay = field.TradingDay();
                    if (string.IsNullOrEmpty(field.SessionID))
                    {
                        OrderPrefix = string.Empty;
                    }
                    else
                    {
                        OrderPrefix = field.SessionID.EndsWith(":") ? field.SessionID : field.SessionID + ":";
                    }
                    OrderIdBase = int.Parse(field.Text);
                }
                OnConnected();
                break;

            case ConnectionStatus.Disconnected:
                OnDisconnected();
                break;
            }
        }
예제 #2
0
        protected virtual void OnStatusChanged(object sender, ConnectionStatus status, RspUserLoginField field)
        {
            Logger.Info(status);
            if (field != null && status == ConnectionStatus.Logined)
            {
                Logger.Info(field.RawErrorID != 0 ? field.RawErrorMsg() : field.DebugInfo());
            }

            switch (status)
            {
            case ConnectionStatus.Done:
                TradingDay = field.TradingDay();
                OnConnected();
                break;

            case ConnectionStatus.Disconnected:
                OnDisconnected();
                break;
            }
        }