//状态变化 private void _onConnectionStatus(object sender, XAPI.ConnectionStatus brokerStatus, ref RspUserLoginField userLogin, int size1) { FreeQuant.Framework.ConnectionStatus status = ConvertUtil.ConvertConnectionStatus(brokerStatus); mOnStatusChanged?.Invoke(status); // LogUtil.SysLog("交易状态:" + brokerStatus.ToString()); }
private void XApi_OnConnectionStatus(object sender, XAPI.ConnectionStatus status, ref XAPI.RspUserLoginField userLogin, int size1) { if (onConnectionStatus == null) { return; } LoginInfo loginInfo = StructTransfer.TransferUserLogin(userLogin); onConnectionStatus(sender, EnumTransfer.TransferConnectionStatus(status), ref loginInfo); }
/// <summary> /// 转换连接状态 /// </summary> /// <param name="borkerStatus"></param> /// <returns></returns> public static FreeQuant.Framework.ConnectionStatus ConvertConnectionStatus(XAPI.ConnectionStatus borkerStatus) { switch (borkerStatus) { case XAPI.ConnectionStatus.Done: return(FreeQuant.Framework.ConnectionStatus.Connected); case XAPI.ConnectionStatus.Disconnected: return(FreeQuant.Framework.ConnectionStatus.Disconnected); default: return(FreeQuant.Framework.ConnectionStatus.Connecting); } }