예제 #1
0
        public override void Serialize(XmlElement node)
        {
            base.Serialize(node);

            var startMultNode = node.OwnerDocument.CreateElement("StartMultiplicity");

            startMultNode.InnerText = StartMultiplicity.ToString();
            node.AppendChild(startMultNode);

            var endMultNode = node.OwnerDocument.CreateElement("EndMultiplicity");

            endMultNode.InnerText = EndMultiplicity.ToString();
            node.AppendChild(endMultNode);
        }
예제 #2
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="node"/> is null.
        /// </exception>
        protected internal override void Serialize(XmlElement node)
        {
            base.Serialize(node);

            XmlElement directionNode = node.OwnerDocument.CreateElement("Direction");

            directionNode.InnerText = Direction.ToString();
            node.AppendChild(directionNode);

            XmlElement aggregationNode = node.OwnerDocument.CreateElement("AssociationType");

            aggregationNode.InnerText = AssociationType.ToString();
            node.AppendChild(aggregationNode);

            if (StartRole != null)
            {
                XmlElement roleNode = node.OwnerDocument.CreateElement("StartRole");
                roleNode.InnerText = StartRole.ToString();
                node.AppendChild(roleNode);
            }
            if (EndRole != null)
            {
                XmlElement roleNode = node.OwnerDocument.CreateElement("EndRole");
                roleNode.InnerText = EndRole.ToString();
                node.AppendChild(roleNode);
            }
            if (StartMultiplicity != null)
            {
                XmlElement multiplicityNode = node.OwnerDocument.CreateElement("StartMultiplicity");
                multiplicityNode.InnerText = StartMultiplicity.ToString();
                node.AppendChild(multiplicityNode);
            }
            if (EndMultiplicity != null)
            {
                XmlElement multiplicityNode = node.OwnerDocument.CreateElement("EndMultiplicity");
                multiplicityNode.InnerText = EndMultiplicity.ToString();
                node.AppendChild(multiplicityNode);
            }
        }