public override Shape Clone() { ElementNodeShape result = new ElementNodeShape(Type, (Template)null); result.CopyFrom(this); return(result); }
private ElementNodeShape _CreateShapeFromElement(ElementNode node) { ElementNodeShape elementShape = _MakeElementNodeShape(node, 1); if (elementShape != null) { _elementShapes.Add(elementShape); } return(elementShape); }
public override void CopyFrom(Shape source) { base.CopyFrom(source); if (source is ElementNodeShape) { ElementNodeShape src = (ElementNodeShape)source; _node = src.Node; _CopyControlPointsFrom(src); } }
private ElementNodeShape _MakeElementNodeShape(ElementNode node, int zOrder) { ElementNodeShape shape = (ElementNodeShape)project.ShapeTypes["ElementNodeShape"].CreateInstance(); shape.SetElementNode(node); shape.Title = node.Name; diagramDisplay.InsertShape(shape); diagramDisplay.Diagram.Shapes.SetZOrder(shape, zOrder); diagramDisplay.Diagram.AddShapeToLayers(shape, _visibleLayer.Id); if (!_elementNodeToElementShapes.ContainsKey(node)) { _elementNodeToElementShapes[node] = new List <ElementNodeShape>(); } _elementNodeToElementShapes[node].Add(shape); if (shape.DataFlowComponent != null) { if (!_dataFlowComponentToShapes.ContainsKey(shape.DataFlowComponent)) { _dataFlowComponentToShapes[shape.DataFlowComponent] = new List <FilterSetupShapeBase>(); } _dataFlowComponentToShapes[shape.DataFlowComponent].Add(shape); } if (node.Children.Any()) { foreach (var child in node.Children) { FilterSetupShapeBase childSetupShapeBase = _MakeElementNodeShape(child, zOrder + 1); shape.ChildFilterShapes.Add(childSetupShapeBase); } shape.SecurityDomainName = SECURITY_DOMAIN_FIXED_SHAPE_NO_CONNECTIONS; shape.FillStyle = project.Design.FillStyles["ElementGroup"]; } else { shape.SecurityDomainName = SECURITY_DOMAIN_FIXED_SHAPE_WITH_CONNECTIONS; shape.FillStyle = project.Design.FillStyles["ElementLeaf"]; } return(shape); }
public override Shape Clone() { ElementNodeShape result = new ElementNodeShape(Type, (Template) null); result.CopyFrom(this); return result; }