public LayerEnumerator GetEnumerator() { LayerEnumerator enumerator1 = this; enumerator1.Reset(); return(enumerator1); }
IEnumerator IEnumerable.GetEnumerator() { LayerEnumerator enumerator1 = this; enumerator1.Reset(); return(enumerator1); }
internal LayerCollectionObjectEnumerator(ArrayList a, bool forward) { this.myArray = a; this.myForward = forward; this.myIndex = -1; this.myEnumerator = new LayerEnumerator(a, true); this.myEnumeratorValid = false; this.Reset(); }
public bool MoveNext() { if (this.myEnumeratorValid) { if (this.myEnumerator.MoveNext()) { return true; } this.myEnumeratorValid = false; } if (this.myForward) { while ((this.myIndex + 1) < this.myArray.Count) { this.myIndex++; DiagramLayer layer1 = (DiagramLayer)this.myArray[this.myIndex]; this.myEnumerator = layer1.GetEnumerator(); this.myEnumeratorValid = true; if (this.myEnumerator.MoveNext()) { return true; } } return false; } while ((this.myIndex - 1) >= 0) { this.myIndex--; DiagramLayer layer2 = (DiagramLayer)this.myArray[this.myIndex]; this.myEnumerator = layer2.Backwards; this.myEnumeratorValid = true; if (this.myEnumerator.MoveNext()) { return true; } } return false; }
public bool MoveNext() { if (this.myEnumeratorValid) { if (this.myEnumerator.MoveNext()) { return(true); } this.myEnumeratorValid = false; } if (this.myForward) { while ((this.myIndex + 1) < this.myArray.Count) { this.myIndex++; DiagramLayer layer1 = (DiagramLayer)this.myArray[this.myIndex]; this.myEnumerator = layer1.GetEnumerator(); this.myEnumeratorValid = true; if (this.myEnumerator.MoveNext()) { return(true); } } return(false); } while ((this.myIndex - 1) >= 0) { this.myIndex--; DiagramLayer layer2 = (DiagramLayer)this.myArray[this.myIndex]; this.myEnumerator = layer2.Backwards; this.myEnumeratorValid = true; if (this.myEnumerator.MoveNext()) { return(true); } } return(false); }
public virtual Shapes.IDiagramPort PickNearestPort(PointF dc) { Shapes.IDiagramPort port1 = null; float single1 = base.View.PortGravity; single1 *= single1; LayerCollectionEnumerator enumerator1 = base.View.Layers.Backwards.GetEnumerator(); while (enumerator1.MoveNext()) { DiagramLayer layer1 = enumerator1.Current; if (layer1.IsInDocument && layer1.CanViewObjects()) { LayerEnumerator enumerator3 = layer1.Backwards.GetEnumerator(); while (enumerator3.MoveNext()) { Shapes.DiagramShape obj1 = enumerator3.Current; port1 = this.pickNearestPort1(obj1, dc, port1, ref single1); } } } return(port1); }
public Shapes.DiagramShape PickObject(PointF p, bool selectableOnly) { if (this.CanViewObjects()) { if (selectableOnly && !this.CanSelectObjects()) { return(null); } 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.DiagramShape obj2 = obj1.Pick(p, selectableOnly); if (obj2 != null) { return(obj2); } } } else { LayerEnumerator enumerator1 = this.Backwards.GetEnumerator(); while (enumerator1.MoveNext()) { Shapes.DiagramShape obj4 = enumerator1.Current.Pick(p, selectableOnly); if (obj4 != null) { return(obj4); } } } } return(null); }
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); }