예제 #1
0
        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);
            }
        }
예제 #2
0
 private void AddClass()
 {
     var element = new ClassElement();
     element.Name = "New Class";
     DiagramNode.Parent.GetChild<NamespaceElement>().AddChild(element);
 }
예제 #3
0
        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;
        }