private static void ApplyInterfaceToClass(Shape end, ClassElement startElement) { var endInterface = end as UmlInterface; var endElement = (endInterface.DataSource as UmlInterfaceData).Owner.Type as InterfaceElement; bool exists = false; foreach (ImplementationElement existingImpl in startElement.GetChildren<ImplementationElement>()) { if (existingImpl.InterfaceName == endElement.Name) { exists = true; break; } } if (!exists) { var implementation = new ImplementationElement(); implementation.InterfaceName = endElement.Name; startElement.AddChild(implementation); } }
private void AddClass() { var element = new ClassElement(); element.Name = "New Class"; DiagramNode.Parent.GetChild<NamespaceElement>().AddChild(element); }
private static void ApplyBaseClassToClass(Shape end, ClassElement startElement) { var endClass = end as UmlClass; var endElement = (endClass.DataSource as UmlClassData).Owner.Type as ClassElement; startElement.Inherits = endElement.Name; }