/// <summary> /// 将TThostFtdcForceCloseReasonType枚举型转为ForceCloseReasonType枚举型 /// </summary> /// <param name="tfcrt">TThostFtdcForceCloseReasonType枚举型</param> /// <returns></returns> public static ForceCloseReason TThostFtdcForceCloseReasonType_To_ForceCloseReason(TThostFtdcForceCloseReasonType tfcrt) { ForceCloseReason fcrt = ForceCloseReason.NotForceClose; switch (tfcrt) { case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_NotForceClose: //fcrt = ForceCloseReasonType.NotForceClose; break; case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_LackDeposit: fcrt = ForceCloseReason.LackDeposit; break; case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_ClientOverPositionLimit: fcrt = ForceCloseReason.ClientOverPositionLimit; break; case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_MemberOverPositionLimit: fcrt = ForceCloseReason.MemberOverPositionLimit; break; case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_NotMultiple: fcrt = ForceCloseReason.NotMultiple; break; case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_Violation: fcrt = ForceCloseReason.Violation; break; case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_Other: fcrt = ForceCloseReason.Other; break; case TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_PersonDeliv: fcrt = ForceCloseReason.PersonDeliv; break; default: break; } return(fcrt); }
public override int GetHashCode() { int hash = 1; if (BrokerId.Length != 0) { hash ^= BrokerId.GetHashCode(); } if (InvestorId.Length != 0) { hash ^= InvestorId.GetHashCode(); } if (UserId.Length != 0) { hash ^= UserId.GetHashCode(); } if (InstrumentId.Length != 0) { hash ^= InstrumentId.GetHashCode(); } if (ExchangeId.Length != 0) { hash ^= ExchangeId.GetHashCode(); } if (OrderPriceType != 0) { hash ^= OrderPriceType.GetHashCode(); } if (Direction != 0) { hash ^= Direction.GetHashCode(); } if (CombOffsetFlag != 0) { hash ^= CombOffsetFlag.GetHashCode(); } if (CombHedgeFlag != 0) { hash ^= CombHedgeFlag.GetHashCode(); } if (LimitPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LimitPrice); } if (VolumeTotalOriginal != 0) { hash ^= VolumeTotalOriginal.GetHashCode(); } if (TimeCondition != 0) { hash ^= TimeCondition.GetHashCode(); } if (VolumeCondition != 0) { hash ^= VolumeCondition.GetHashCode(); } if (MinVolume != 0) { hash ^= MinVolume.GetHashCode(); } if (ContigentCondition != 0) { hash ^= ContigentCondition.GetHashCode(); } if (StopPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(StopPrice); } if (ForceCloseReason != 0) { hash ^= ForceCloseReason.GetHashCode(); } if (IsAutoSuspend != 0) { hash ^= IsAutoSuspend.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// ForceCloseReason枚举型转为TThostFtdcForceCloseReasonType枚举型 /// </summary> /// <param name="fcr">ForceCloseReason枚举型</param> /// <returns></returns> public static TThostFtdcForceCloseReasonType ForceCloseReason_To_TThostFtdcForceCloseReasonType(ForceCloseReason fcr) { TThostFtdcForceCloseReasonType tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_NotForceClose; switch (fcr) { case ForceCloseReason.NotForceClose: break; case ForceCloseReason.LackDeposit: tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_LackDeposit; break; case ForceCloseReason.ClientOverPositionLimit: tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_ClientOverPositionLimit; break; case ForceCloseReason.MemberOverPositionLimit: tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_MemberOverPositionLimit; break; case ForceCloseReason.NotMultiple: tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_NotMultiple; break; case ForceCloseReason.Violation: tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_Violation; break; case ForceCloseReason.Other: tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_Other; break; case ForceCloseReason.PersonDeliv: tffcrt = TThostFtdcForceCloseReasonType.THOST_FTDC_FCC_PersonDeliv; break; default: break; } return(tffcrt); }