Esempio n. 1
0
 private static void TranslateInheritanceConnectors(
     InheritanceConnector dslInheritanceConnector, DesignerModel.InheritanceConnector modelInheritanceConnector,
     IList <ViewModelDiagram.ShapeElement> shapesToAutoLayout)
 {
     dslInheritanceConnector.ManuallyRouted = modelInheritanceConnector.ManuallyRouted.Value;
     // if the EdgePoint values is an empty collection or connectors are not manually routed, add the shape element to the collections that will be autolayout.
     if (modelInheritanceConnector.ManuallyRouted.Value == false ||
         modelInheritanceConnector.ConnectorPoints.Count == 0)
     {
         if (shapesToAutoLayout.Contains(dslInheritanceConnector) == false)
         {
             shapesToAutoLayout.Add(dslInheritanceConnector);
         }
     }
     else
     {
         var collection = new ViewModelDiagram.EdgePointCollection();
         foreach (var connectorPoint in modelInheritanceConnector.ConnectorPoints)
         {
             collection.Add(
                 new ViewModelDiagram.EdgePoint(connectorPoint.PointX.Value, connectorPoint.PointY.Value, VGPointType.Normal));
         }
         if (AreEdgePointsIdentical(dslInheritanceConnector.EdgePoints, collection) == false)
         {
             dslInheritanceConnector.EdgePoints = collection;
         }
     }
 }
Esempio n. 2
0
 internal override bool ParseSingleElement(ICollection <XName> unprocessedElements, XElement elem)
 {
     if (elem.Name.LocalName == EntityTypeShape.ElementName)
     {
         var shape = new EntityTypeShape(this, elem);
         shape.Parse(unprocessedElements);
         _entityTypeShapes.Add(shape);
     }
     else if (elem.Name.LocalName == AssociationConnector.ElementName)
     {
         var associationConnector = new AssociationConnector(this, elem);
         associationConnector.Parse(unprocessedElements);
         _associationConnectors.Add(associationConnector);
     }
     else if (elem.Name.LocalName == InheritanceConnector.ElementName)
     {
         var inheritanceConnector = new InheritanceConnector(this, elem);
         inheritanceConnector.Parse(unprocessedElements);
         _inheritanceConnectors.Add(inheritanceConnector);
     }
     else
     {
         return(base.ParseSingleElement(unprocessedElements, elem));
     }
     return(true);
 }
        protected override void InvokeInternal(CommandProcessorContext cpc)
        {
            var inheritanceConnector = new InheritanceConnector(_diagram, null);
            _diagram.AddInheritanceConnector(inheritanceConnector);

            inheritanceConnector.EntityType.SetRefName(_entity);

            XmlModelHelper.NormalizeAndResolve(inheritanceConnector);

            _created = inheritanceConnector;
        }
Esempio n. 4
0
 internal void AddInheritanceConnector(InheritanceConnector connector)
 {
     _inheritanceConnectors.Add(connector);
 }