public Shapes.IDiagramShapeCollection AddCollection(Shapes.IDiagramShapeCollection coll, bool reparentLinks) { Shapes.DiagramShapeCollection collection1 = new Shapes.DiagramShapeCollection(); foreach (Shapes.DiagramShape obj1 in coll) { collection1.Add(obj1); } CollectionEnumerator enumerator2 = collection1.GetEnumerator(); while (enumerator2.MoveNext()) { Shapes.DiagramShape obj2 = enumerator2.Current; bool flag1 = obj2.Layer != null; if (flag1) { Shapes.GroupShape.setAllNoClear(obj2, true); obj2.Remove(); } this.Add(obj2); if (flag1) { Shapes.GroupShape.setAllNoClear(obj2, false); } } if (reparentLinks && this.IsInDocument) { Shapes.SubGraphNode.ReparentAllLinksToSubGraphs(collection1, true, this.Document.LinksLayer); } return(collection1); }
public virtual DiagramSelection ComputeEffectiveSelection(Shapes.IDiagramShapeCollection coll, bool move) { Hashtable hashtable1 = new Hashtable(); Shapes.DiagramShapeCollection collection1 = null; DiagramSelection selection1 = new DiagramSelection(null); Shapes.DiagramShapeCollection collection2 = null; foreach (Shapes.DiagramShape obj1 in coll) { Shapes.DiagramShape obj2 = obj1.DraggingObject; if (((obj2 != null) && !(move ? !obj2.CanMove() : !obj2.CanCopy())) && !this.alreadyDragged(hashtable1, obj2)) { if ((collection1 != null) && (obj2 is Shapes.GroupShape)) { CollectionEnumerator enumerator2 = collection1.GetEnumerator(); while (enumerator2.MoveNext()) { Shapes.DiagramShape obj3 = enumerator2.Current; if (obj3.IsChildOf(obj2)) { hashtable1.Remove(7); if (collection2 == null) { collection2 = new Shapes.DiagramShapeCollection(); } collection2.Add(obj3); selection1.Remove(obj3); } } if ((collection2 != null) && !collection2.IsEmpty) { enumerator2 = collection2.GetEnumerator(); while (enumerator2.MoveNext()) { Shapes.DiagramShape obj4 = enumerator2.Current; collection1.Remove(obj4); } collection2.Clear(); } } hashtable1.Add(obj2, obj2); if (!obj2.IsTopLevel) { if (collection1 == null) { collection1 = new Shapes.DiagramShapeCollection(); } collection1.Add(obj2); } selection1.Add(obj2); } } Shapes.DiagramShape[] objArray1 = selection1.CopyArray(); for (int num1 = 0; num1 < objArray1.Length; num1++) { Shapes.DiagramShape obj5 = objArray1[num1]; Shapes.IDiagramNode node1 = obj5 as Shapes.IDiagramNode; if (node1 != null) { foreach (Shapes.IDiagramLine link1 in node1.DestinationLinks) { if (!this.alreadyDragged(hashtable1, link1.DiagramShape) && ((link1.ToPort == null) || this.alreadyDragged(hashtable1, link1.ToPort.DiagramShape))) { hashtable1.Add(link1.DiagramShape, link1.DiagramShape); selection1.Add(link1.DiagramShape); } } foreach (Shapes.IDiagramLine link2 in node1.SourceLinks) { if (!this.alreadyDragged(hashtable1, link2.DiagramShape) && ((link2.FromPort == null) || this.alreadyDragged(hashtable1, link2.FromPort.DiagramShape))) { hashtable1.Add(link2.DiagramShape, link2.DiagramShape); selection1.Add(link2.DiagramShape); } } } } return(selection1); }
public virtual void DoDragDrop(Shapes.IDiagramShapeCollection coll, DragDropEffects allow) { base.View.DoDragDrop(coll, allow); }
public Shapes.IDiagramShapeCollection PickObjects(PointF p, bool selectableOnly, Shapes.IDiagramShapeCollection coll, int max) { if (coll == null) { coll = new Shapes.DiagramShapeCollection(); } if (coll.Count < max) { if (!this.CanViewObjects()) { return(coll); } if (selectableOnly && !this.CanSelectObjects()) { return(coll); } GoLayerCache cache1 = this.FindCache(p); if (cache1 != null) { ArrayList list1 = cache1.Objects; for (int num2 = list1.Count - 1; num2 >= 0; num2--) { Shapes.DiagramShape obj1 = (Shapes.DiagramShape)list1[num2]; Shapes.GroupShape group1 = obj1 as Shapes.GroupShape; if (group1 != null) { group1.PickObjects(p, selectableOnly, coll, max); } else { Shapes.DiagramShape obj2 = obj1.Pick(p, selectableOnly); if (obj2 != null) { coll.Add(obj2); if (coll.Count >= max) { return(coll); } } } } return(coll); } LayerEnumerator enumerator1 = this.Backwards.GetEnumerator(); while (enumerator1.MoveNext()) { Shapes.DiagramShape obj3 = enumerator1.Current; Shapes.GroupShape group2 = obj3 as Shapes.GroupShape; if (group2 != null) { group2.PickObjects(p, selectableOnly, coll, max); continue; } Shapes.DiagramShape obj4 = obj3.Pick(p, selectableOnly); if (obj4 != null) { coll.Add(obj4); if (coll.Count >= max) { return(coll); } } } } return(coll); }
public CopyDictionary() { this._SourceCollection = null; this._DestinationDocument = null; this._Delayeds = new CopyDelayedsCollection(); }