예제 #1
0
 protected static void AddItems(IEnumerable<EaItem> items, XElement xmlElent, XmlGenerationConfig config)
 {
     foreach (var item in items)
     {
         var xml = item.GetXml(config);
         xmlElent.Add(xml);
     }
 }
예제 #2
0
        public override XElement GetXml(XmlGenerationConfig config)
        {
            var result = base.GetXml(config);

            EaItem.AddItems(Properties, result, config);
            EaItem.AddItems(Generalizations, result, config);

            return result;
        }
예제 #3
0
        public override XElement GetXml(XmlGenerationConfig config)
        {
            //<ownedAttribute xmi:type="uml:Property" xmi:id="EAID_B8A8526F_1A9C_49c5_8DEC_AE546F181495" name="Prop1" ></ownedAttribute>

            var result = new XElement("ownedAttribute",
                new XAttribute(config.xmi + "type", GetTypeValue()),
                new XAttribute(config.xmi + "id", Id),
                new XAttribute("name", Name)
                );
            return result;
        }
예제 #4
0
        public override XElement GetXml(XmlGenerationConfig config)
        {
            var result = new XElement("packagedElement",
                new XAttribute(config.xmi + "type", GetTypeValue()),
                new XAttribute(config.xmi + "id", Id),
                new XAttribute("name", Name)
                );

            EaItem.AddItems(Items, result, config);

            return result;
        }
예제 #5
0
        public override XElement GetXml(XmlGenerationConfig config)
        {
            //<generalization xmi:type="uml:Generalization" xmi:id="EAID_80F022B1_2C22_4ac2_864F_BCDBAD9B89E7" general="EAID_92AE7CB3_831F_4a29_ABFB_30AE7E39B63A"/>

            var result = new XElement("generalization",
                new XAttribute(config.xmi + "type", GetTypeValue()),
                new XAttribute(config.xmi + "id", Id),
                new XAttribute("name", Name),
                new XAttribute("general", General)
                );
            return result;
        }
예제 #6
0
        public XElement GetRootXml(XmlGenerationConfig config)
        {
            //<xmi:XMI xmi:version="2.1" xmlns:uml="http://schema.omg.org/spec/UML/2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1">
              //<xmi:Documentation exporter="Enterprise Architect" exporterVersion="6.5"/>
              //<uml:Model xmi:type="uml:Model" name="EA_Model" visibility="public">

            XElement result = new XElement(config.xmi + "XMI",
                new XAttribute(XNamespace.Xmlns + "xmi", config.xmi.NamespaceName),
                new XAttribute(XNamespace.Xmlns + "uml", config.uml.NamespaceName),
                new XAttribute(config.xmi + "version", "2.1"),
                new XElement(config.xmi + "Documentation",
                    new XAttribute("exporterVersion", "6.5")
                    )
                );
            var model = new XElement(config.uml + "Model",
                new XAttribute(config.xmi + "type", "uml:Model"),
                new XAttribute("name", "Templates")
                );

            model.Add(GetXml(config));
            result.Add(model);

            return result;
        }
예제 #7
0
 /// <summary>
 /// Returns XML for object. Kind of serialization.
 /// </summary>
 /// <returns></returns>
 public abstract XElement GetXml(XmlGenerationConfig config);