示例#1
0
        /// <summary>
        /// The PopulateMessages method populates the messages in
        /// an XmlDictionary instance with the message definitions
        /// from the source dictionary.
        /// </summary>
        /// <param name="xmlDictionary">
        /// The XmlDictionary instance that the message definitions
        /// are to be added to.
        /// </param>
        /// <param name="fixDictionary">
        /// The FixDictionary instance that is the source of the
        /// elements the XmlDictionary is to be populated with.
        /// </param>
        private static void PopulateMessages(XmlDictionary xmlDictionary, FixDictionary fixDictionary)
        {
            // REC: Iterate over all of the message definitions in the
            // source dictionary and convert them to XML serializable
            // representations for the serializable dictionary:
            foreach (FixDxMessage dxMessage in fixDictionary.Messages)
            {
                XmlFixDxMessage xmlMessage = new XmlFixDxMessage();
                xmlMessage.Name        = dxMessage.Name;
                xmlMessage.MsgType     = dxMessage.MsgType;
                xmlMessage.MsgCategory = dxMessage.MsgCategory;

                XmlFixDxElements xmlElements = TranslateElements(dxMessage.Elements);
                foreach (object xmlElement in xmlElements.Elements)
                {
                    xmlMessage.Elements.Add(xmlElement);
                }

                xmlDictionary.Messages.Entries.Add(xmlMessage);
            }
        }
示例#2
0
        /// <summary>
        /// The PopulateMessages method populates the messages in
        /// an XmlDictionary instance with the message definitions
        /// from the source dictionary.
        /// </summary>
        /// <param name="xmlDictionary">
        /// The XmlDictionary instance that the message definitions
        /// are to be added to.
        /// </param>
        /// <param name="fixDictionary">
        /// The FixDictionary instance that is the source of the
        /// elements the XmlDictionary is to be populated with.
        /// </param>
        private static void PopulateMessages(XmlDictionary xmlDictionary, FixDictionary fixDictionary)
        {
            // REC: Iterate over all of the message definitions in the
            // source dictionary and convert them to XML serializable
            // representations for the serializable dictionary:
            foreach (FixDxMessage dxMessage in fixDictionary.Messages)
            {
                XmlFixDxMessage xmlMessage = new XmlFixDxMessage();
                xmlMessage.Name = dxMessage.Name;
                xmlMessage.MsgType = dxMessage.MsgType;
                xmlMessage.MsgCategory = dxMessage.MsgCategory;

                XmlFixDxElements xmlElements = TranslateElements(dxMessage.Elements);
                foreach (object xmlElement in xmlElements.Elements)
                {
                    xmlMessage.Elements.Add(xmlElement);
                }

                xmlDictionary.Messages.Entries.Add(xmlMessage);
            }
        }