public static int ToFIX(PosReqType value) { switch (value) { case PosReqType.Positions: return Positions; case PosReqType.Trades: return Trades; case PosReqType.Exercises: return Exercises; case PosReqType.Assignments: return Assignments; default: throw new ArgumentException(string.Format("value not supported {0}", value)); } }
public int GetMessageSize() // подсчет длины строки сообщения { string tmpString = String.Format("{0}={1}\u0001{2}={3}\u0001{4}={5}\u0001", // {6}={7}\u0001{8}={9}\u0001 (int)Tags.PosReqID, PosReqID.ToString(), (int)Tags.PosReqType, PosReqType.ToString(), (int)Tags.SubscriptionRequestType, SubscriptionRequestType //(int)Tags.PartyID, //PartyID.ToString(), //(int)Tags.PartyRole, //PartyRole.ToString() ); return(tmpString.Length); }
public override string ToString() // формирование строки сообщения { MessageString = String.Format("{0}={1}\u0001{2}={3}\u0001{4}={5}\u0001", // {6}={7}\u0001{8}={9}\u0001 (int)Tags.PosReqID, PosReqID.ToString(), (int)Tags.PosReqType, PosReqType.ToString(), (int)Tags.SubscriptionRequestType, SubscriptionRequestType //(int)Tags.PartyID, //PartyID.ToString(), //(int)Tags.PartyRole, //PartyRole.ToString() ); MessageSize = MessageString.Length; return(MessageString); }
public static int ToFIX(PosReqType value) { switch (value) { case PosReqType.Positions: return(Positions); case PosReqType.Trades: return(Trades); case PosReqType.Exercises: return(Exercises); case PosReqType.Assignments: return(Assignments); default: throw new ArgumentException(string.Format("value not supported {0}", value)); } }