Esempio n. 1
0
        internal GoLayerCache FindCache(RectangleF r)
        {
            GoLayerCache cache1 = null;

            foreach (GoLayerCache cache2 in this.Caches)
            {
                if (!Shapes.DiagramShape.ContainsRect(cache2.Rect, r) || ((cache1 != null) && (cache2.Objects.Count >= cache1.Objects.Count)))
                {
                    continue;
                }
                cache1 = cache2;
            }
            return(cache1);
        }
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);
 }
Esempio n. 4
0
        public void Paint(Graphics g, DiagramView view, RectangleF clipRect)
        {
            bool flag1 = view.IsPrinting;

            if (!(flag1 ? !this.CanPrintObjects() : !this.CanViewObjects()))
            {
                RectangleF   ef1    = view.DocExtent;
                GoLayerCache cache1 = this.FindCache(view);
                if ((cache1 != null) && (cache1.Rect == ef1))
                {
                    foreach (Shapes.DiagramShape obj1 in cache1.Objects)
                    {
                        if (!(flag1 ? obj1.CanPrint() : obj1.CanView()))
                        {
                            continue;
                        }
                        RectangleF ef2 = obj1.Bounds;
                        ef2 = obj1.ExpandPaintBounds(ef2, view);
                        if (Shapes.DiagramShape.IntersectsRect(ef2, clipRect))
                        {
                            obj1.Paint(g, view);
                        }
                    }
                }
                else
                {
                    LayerEnumerator enumerator2;
                    if (this.CacheWanted(view))
                    {
                        if (cache1 == null)
                        {
                            cache1 = new GoLayerCache(view);
                            this.Caches.Add(cache1);
                        }
                        else
                        {
                            cache1.Reset();
                        }
                        cache1.Rect = ef1;
                        enumerator2 = this.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            Shapes.DiagramShape obj2 = enumerator2.Current;
                            RectangleF          ef3  = obj2.Bounds;
                            ef3 = obj2.ExpandPaintBounds(ef3, view);
                            if ((flag1 ? obj2.CanPrint() : obj2.CanView()) && Shapes.DiagramShape.IntersectsRect(ef3, clipRect))
                            {
                                obj2.Paint(g, view);
                            }
                            if (Shapes.DiagramShape.IntersectsRect(ef3, ef1))
                            {
                                cache1.Objects.Add(obj2);
                            }
                        }
                    }
                    else
                    {
                        enumerator2 = this.GetEnumerator();
                        while (enumerator2.MoveNext())
                        {
                            Shapes.DiagramShape obj3 = enumerator2.Current;
                            if (flag1 ? obj3.CanPrint() : obj3.CanView())
                            {
                                RectangleF ef4 = obj3.Bounds;
                                ef4 = obj3.ExpandPaintBounds(ef4, view);
                                if (Shapes.DiagramShape.IntersectsRect(ef4, clipRect))
                                {
                                    obj3.Paint(g, view);
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 5
0
 public void Paint(Graphics g, DiagramView view, RectangleF clipRect)
 {
     bool flag1 = view.IsPrinting;
     if (!(flag1 ? !this.CanPrintObjects() : !this.CanViewObjects()))
     {
         RectangleF ef1 = view.DocExtent;
         GoLayerCache cache1 = this.FindCache(view);
         if ((cache1 != null) && (cache1.Rect == ef1))
         {
             foreach (Shapes.DiagramShape obj1 in cache1.Objects)
             {
                 if (!(flag1 ? obj1.CanPrint() : obj1.CanView()))
                 {
                     continue;
                 }
                 RectangleF ef2 = obj1.Bounds;
                 ef2 = obj1.ExpandPaintBounds(ef2, view);
                 if (Shapes.DiagramShape.IntersectsRect(ef2, clipRect))
                 {
                     obj1.Paint(g, view);
                 }
             }
         }
         else
         {
             LayerEnumerator enumerator2;
             if (this.CacheWanted(view))
             {
                 if (cache1 == null)
                 {
                     cache1 = new GoLayerCache(view);
                     this.Caches.Add(cache1);
                 }
                 else
                 {
                     cache1.Reset();
                 }
                 cache1.Rect = ef1;
                 enumerator2 = this.GetEnumerator();
                 while (enumerator2.MoveNext())
                 {
                     Shapes.DiagramShape obj2 = enumerator2.Current;
                     RectangleF ef3 = obj2.Bounds;
                     ef3 = obj2.ExpandPaintBounds(ef3, view);
                     if ((flag1 ? obj2.CanPrint() : obj2.CanView()) && Shapes.DiagramShape.IntersectsRect(ef3, clipRect))
                     {
                         obj2.Paint(g, view);
                     }
                     if (Shapes.DiagramShape.IntersectsRect(ef3, ef1))
                     {
                         cache1.Objects.Add(obj2);
                     }
                 }
             }
             else
             {
                 enumerator2 = this.GetEnumerator();
                 while (enumerator2.MoveNext())
                 {
                     Shapes.DiagramShape obj3 = enumerator2.Current;
                     if (flag1 ? obj3.CanPrint() : obj3.CanView())
                     {
                         RectangleF ef4 = obj3.Bounds;
                         ef4 = obj3.ExpandPaintBounds(ef4, view);
                         if (Shapes.DiagramShape.IntersectsRect(ef4, clipRect))
                         {
                             obj3.Paint(g, view);
                         }
                     }
                 }
             }
         }
     }
 }