/// <summary> /// The PopulateMessages method is invoked to convert all of /// the message definitions in a QuickFix dictionary into their /// corresponding representations in a VersaFix dictionary. /// </summary> /// <param name="src"> /// The source dictionary for the converted elements. /// </param> /// <param name="dst"> /// The target dictionary for the converted elements. /// </param> private void PopulateMessages(XmlQfxDictionary src, FixDictionary dst) { foreach (object message in src.Messages) { XmlQfxMessage xmlMessage = message as XmlQfxMessage; if (xmlMessage != null) { FixDxMessage dxMessage = new FixDxMessage(xmlMessage.MsgType, xmlMessage.Name, xmlMessage.MsgCategory); foreach (object element in xmlMessage.Elements) { dxMessage.Elements.Add(ConvertElement(element)); } dst.Messages.Add(dxMessage); } } }
/// <summary> /// The ExportMessages method is invoked to convert all of /// the message elements in an instance of a VersaFix data /// dictionary into corresponding entries in an instance /// of an XML representation of a QuickFix dictionary. /// </summary> /// <param name="src"> /// The source dictionary for the message definitions. /// </param> /// <param name="dst"> /// The target dictionary for the message definitions. /// </param> private void ExportMessages(FixDictionary src, XmlQfxDictionary dst) { foreach (IFixDxElement dxElement in src.Messages) { FixDxMessage dxMessage = dxElement as FixDxMessage; if (dxMessage != null) { XmlQfxMessage xmlMessage = new XmlQfxMessage(); xmlMessage.Name = dxMessage.Name; xmlMessage.MsgType = dxMessage.MsgType; xmlMessage.MsgCategory = dxMessage.MsgCategory; foreach (IFixDxElement dxMessageElement in dxMessage.Elements) { ExportElement(dxMessageElement, xmlMessage.Elements); } dst.Messages.Add(xmlMessage); } } }