Beispiel #1
0
        private static void TranslateAssociationConnectors(
            AssociationConnector dslAssociationConnector, DesignerModel.AssociationConnector modelAssociationConnector,
            IList <ViewModelDiagram.ShapeElement> shapesToAutoLayout)
        {
            dslAssociationConnector.ManuallyRouted = modelAssociationConnector.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 (modelAssociationConnector.ManuallyRouted.Value == false ||
                modelAssociationConnector.ConnectorPoints.Count == 0)
            {
                if (shapesToAutoLayout.Contains(dslAssociationConnector) == false)
                {
                    shapesToAutoLayout.Add(dslAssociationConnector);
                }
            }
            else
            {
                var collection = new ViewModelDiagram.EdgePointCollection();
                foreach (var connectorPoint in modelAssociationConnector.ConnectorPoints)
                {
                    collection.Add(
                        new ViewModelDiagram.EdgePoint(connectorPoint.PointX.Value, connectorPoint.PointY.Value, VGPointType.Normal));
                }

                if (AreEdgePointsIdentical(dslAssociationConnector.EdgePoints, collection) == false)
                {
                    dslAssociationConnector.EdgePoints = collection;
                }
            }
        }
Beispiel #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 associationConnector = new AssociationConnector(_diagram, null);
            _diagram.AddAssociationConnector(associationConnector);

            associationConnector.Association.SetRefName(_association);

            XmlModelHelper.NormalizeAndResolve(associationConnector);

            _created = associationConnector;
        }
Beispiel #4
0
 internal void AddAssociationConnector(AssociationConnector connector)
 {
     _associationConnectors.Add(connector);
 }