Exemplo n.º 1
0
 internal override XElement ToXml(TaggedValueDefinition versionTag)
 {
     return(new XElement("Stereotype", new XAttribute("name", Name), new XAttribute("metatype", DisplayName),
                         new XAttribute("instanceType", InstanceType.Select(it => it.Name).GetOrElse("")),
                         new XAttribute("bgcolor", BackgroundColor.Select(bg => ToEaColor(bg)).GetOrElse("")),
                         new XAttribute("cx", Width.Select(w => w.ToString()).GetOrElse("")),
                         new XAttribute("cy", Height.Select(h => h.ToString()).GetOrElse("")),
                         Icon.Select <Icon, XNode>(i => i.ToXml()).GetOrElse(new XComment("no custom icon")),
                         ShapeScript.Select <String, XNode>(s => new ShapeScript(s).ToXml()).GetOrElse(new XComment("no custom shape")),
                         new XElement("AppliesTo",
                                      new XElement("Apply", new XAttribute("type", Type.ToString()))),
                         new XElement("TaggedValues",
                                      from tv in TaggedValues.Concat(new[] { versionTag })
                                      select tv.ToXml())));
 }