Beispiel #1
0
        private void OnConnectionStatus_callback(object sender, XAPI.ConnectionStatus status, ref RspUserLoginField userLogin, int size1)
        {
            RspUserLoginClass cls = null;

            if (size1 > 0)
            {
                cls = new RspUserLoginClass();
                RspUserLoginField field = userLogin;

                cls.TradingDay   = field.TradingDay;
                cls.LoginTime    = field.LoginTime;
                cls.SessionID    = field.SessionID;
                cls.UserID       = field.UserID;
                cls.AccountID    = field.AccountID;
                cls.InvestorName = field.InvestorName();
                cls.XErrorID     = field.XErrorID;
                cls.RawErrorID   = field.RawErrorID;
                cls.Text         = field.Text();
            }

            if (null == OnConnectionStatus)
            {
                QueueData qd = new QueueData();
                qd.Type        = (int)ResponeType.OnConnectionStatus;
                qd.Type_String = Enum <XAPI.ResponeType> .ToString(ResponeType.OnConnectionStatus);

                qd.Sender = this;
                qd.Data1  = status;
                qd.Data2  = Enum <XAPI.ConnectionStatus> .ToString(status);

                qd.Data3 = cls;
                qd.Data4 = size1;

                MessageQueue.Enqueue(qd);
            }
            else
            {
                OnConnectionStatus(this, (int)status, Enum <XAPI.ConnectionStatus> .ToString(status), ref cls, size1);
            }
        }
Beispiel #2
0
        private void OnConnectionStatus_callback(object sender, XAPI.ConnectionStatus status, ref RspUserLoginField userLogin, int size1)
        {
            RspUserLoginClass cls = null;

            if (size1 > 0)
            {
                cls = new RspUserLoginClass();
                RspUserLoginField field = userLogin;

                cls.TradingDay = field.TradingDay;
                cls.LoginTime = field.LoginTime;
                cls.SessionID = field.SessionID;
                cls.UserID = field.UserID;
                cls.AccountID = field.AccountID;
                cls.InvestorName = field.InvestorName();
                cls.XErrorID = field.XErrorID;
                cls.RawErrorID = field.RawErrorID;
                cls.Text = field.Text();
            }

            if (null == OnConnectionStatus)
            {
                QueueData qd = new QueueData();
                qd.Type = (int)ResponeType.OnConnectionStatus;
                qd.Type_String = Enum<XAPI.ResponeType>.ToString(ResponeType.OnConnectionStatus);
                qd.Sender = this;
                qd.Data1 = status;
                qd.Data2 = Enum<XAPI.ConnectionStatus>.ToString(status);
                qd.Data3 = cls;
                qd.Data4 = size1;

                MessageQueue.Enqueue(qd);
            }
            else
            {
                OnConnectionStatus(this, (int)status, Enum<XAPI.ConnectionStatus>.ToString(status), ref cls, size1);
            }
        }