Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }