Пример #1
0
        private void findAllAux(DiagramShape obj, Search s, ArrayList items)
        {
            IDiagramPort port1 = obj as IDiagramPort;

            if (port1 != null)
            {
                if ((s & Search.Ports) != ((Search)0))
                {
                    this.addItem(items, port1);
                }
                DiagramPort port2 = port1 as DiagramPort;
                if (port2 != null)
                {
                    PortLinkEnumerator enumerator1 = port2.Links.GetEnumerator();
                    while (enumerator1.MoveNext())
                    {
                        IDiagramLine link1 = enumerator1.Current;
                        this.considerLink(link1, port1, s, items);
                    }
                }
                else
                {
                    foreach (IDiagramLine link2 in port1.Links)
                    {
                        this.considerLink(link2, port1, s, items);
                    }
                }
            }
            GroupShape group1 = obj as GroupShape;

            if (group1 != null)
            {
                GroupEnumerator enumerator5 = group1.GetEnumerator();
                GroupEnumerator enumerator4 = enumerator5.GetEnumerator();
                while (enumerator4.MoveNext())
                {
                    DiagramShape obj1 = enumerator4.Current;
                    this.findAllAux(obj1, s, items);
                }
            }
        }
Пример #2
0
 internal LinkInfo[] SortLinks()
 {
     if ((this.mySortedLinks == null) || (this.mySortedLinks.Length != this.LinksCount))
     {
         this.mySortedLinks = new LinkInfo[this.LinksCount];
     }
     if (!this.myRespreading)
     {
         bool flag1 = this.myRespreading;
         this.myRespreading = true;
         int num1 = 0;
         PortLinkEnumerator enumerator1 = this.Links.GetEnumerator();
         while (enumerator1.MoveNext())
         {
             int          num2;
             IDiagramLine link1   = enumerator1.Current;
             float        single1 = this.GetDirection(link1);
             float        single2 = this.GetAngle(link1);
             if (single1 == 0f)
             {
                 num2 = 0x40;
                 if (single2 > 180f)
                 {
                     single2 -= 360f;
                 }
             }
             else if (single1 == 90f)
             {
                 num2 = 0x80;
             }
             else if (single1 == 180f)
             {
                 num2 = 0x100;
             }
             else
             {
                 num2 = 0x20;
             }
             this.mySortedLinks[num1++] = new LinkInfo(link1, single2, num2, single1);
         }
         Array.Sort(this.mySortedLinks, 0, this.mySortedLinks.Length, BoxPort.myComparer);
         int num3 = this.mySortedLinks.Length;
         int num4 = -1;
         int num5 = 0;
         num1 = 0;
         while (num1 < num3)
         {
             LinkInfo info1 = this.mySortedLinks[num1];
             if (info1.Side != num4)
             {
                 num4 = info1.Side;
                 num5 = 0;
             }
             info1.IndexOnSide = num5;
             num5++;
             num1++;
         }
         num4 = -1;
         num5 = 0;
         for (num1 = num3 - 1; num1 >= 0; num1--)
         {
             LinkInfo info2 = this.mySortedLinks[num1];
             if (info2.Side != num4)
             {
                 num4 = info2.Side;
                 num5 = info2.IndexOnSide + 1;
             }
             info2.NumOnSide = num5;
             info2.LinkPoint = this.GetSideLinkPoint(info2);
         }
         this.myRespreading = flag1;
     }
     return(this.mySortedLinks);
 }