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; } }
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; } }