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; } } }
protected override void InvokeInternal(CommandProcessorContext cpc) { var inheritanceConnector = new InheritanceConnector(_diagram, null); _diagram.AddInheritanceConnector(inheritanceConnector); inheritanceConnector.EntityType.SetRefName(_entity); XmlModelHelper.NormalizeAndResolve(inheritanceConnector); _created = inheritanceConnector; }
internal override void Invoke(CommandProcessorContext cpc) { var viewModel = InheritanceConnector.GetRootViewModel(); Debug.Assert(viewModel != null, "Unable to find root view model from inheritance connector: " + InheritanceConnector); if (viewModel != null) { var modelInheritanceConnector = viewModel.ModelXRef.GetExisting(InheritanceConnector) as Model.Designer.InheritanceConnector; if (modelInheritanceConnector != null) { viewModel.ModelXRef.Remove(modelInheritanceConnector, InheritanceConnector); DeleteEFElementCommand.DeleteInTransaction(cpc, modelInheritanceConnector); } } }
protected InheritanceConnectorModelChange(InheritanceConnector inheritanceConnector) { _inheritanceConnector = inheritanceConnector; }
internal InheritanceConnectorDelete(InheritanceConnector inheritanceConnector) : base(inheritanceConnector) { }
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; } } }