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); }