Пример #1
0
        private void method_2(ArrayList arrayList)
        {
            int count = arrayList.Count;

            for (int i = 0; i < count - 1; i++)
            {
                SortInfo sortInfo          = (SortInfo)arrayList[i];
                SortInfo sortInfo2         = (SortInfo)arrayList[i + 1];
                int      pointInfoRleation = sortInfo.GetPointInfoRleation(sortInfo2);
                if (pointInfoRleation == 21)
                {
                    sortInfo.bRightDirection  = true;
                    sortInfo2.bRightDirection = true;
                }
                if (pointInfoRleation == 22)
                {
                    sortInfo.bRightDirection  = true;
                    sortInfo2.bRightDirection = false;
                }
                if (pointInfoRleation == 12)
                {
                    sortInfo.bRightDirection  = false;
                    sortInfo2.bRightDirection = false;
                }
                if (pointInfoRleation == 11)
                {
                    sortInfo.bRightDirection  = false;
                    sortInfo2.bRightDirection = true;
                }
            }
        }
Пример #2
0
        private bool method_3(ArrayList arrayList)
        {
            ArrayList arrayList2 = new ArrayList();
            long      num        = 0L;
            bool      result;

            while (arrayList.Count > 0)
            {
                num += 1L;
                if (num > 50000L)
                {
                    result = false;
                    return(result);
                }
                long num2 = (long)arrayList.Count;
                int  num3 = 0;
                while ((long)num3 < num2)
                {
                    SortInfo sortInfo = (SortInfo)arrayList[num3];
                    if (arrayList2.Count == 0)
                    {
                        arrayList2.Add(sortInfo);
                        arrayList.Remove(sortInfo);
                        break;
                    }
                    SortInfo sortInfo2 = (SortInfo)arrayList2[0];
                    SortInfo sortInfo3 = (SortInfo)arrayList2[arrayList2.Count - 1];
                    if (sortInfo2.GetPointInfoRleation(sortInfo) != -1 || sortInfo3.GetPointInfoRleation(sortInfo) != -1)
                    {
                        int pointInfoRleation  = sortInfo2.GetPointInfoRleation(sortInfo);
                        int pointInfoRleation2 = sortInfo3.GetPointInfoRleation(sortInfo);
                        if (pointInfoRleation == 12)
                        {
                            sortInfo.bRightDirection = true;
                            arrayList2.Insert(0, sortInfo);
                            arrayList.Remove(sortInfo);
                            break;
                        }
                        if (pointInfoRleation == 11)
                        {
                            sortInfo.bRightDirection = false;
                            sortInfo.SwapFromWithTo();
                            arrayList2.Insert(0, sortInfo);
                            arrayList.Remove(sortInfo);
                            break;
                        }
                        if (pointInfoRleation2 == 21)
                        {
                            sortInfo.bRightDirection = true;
                            arrayList2.Add(sortInfo);
                            arrayList.Remove(sortInfo);
                            break;
                        }
                        if (pointInfoRleation2 == 22)
                        {
                            sortInfo.bRightDirection = false;
                            arrayList2.Add(sortInfo);
                            arrayList.Remove(sortInfo);
                            break;
                        }
                    }
                    num3++;
                }
            }
            this.m_SectionControl.m_arrSortInfo = arrayList2;
            this.m_SectionControl.SortForVerAnalyse();
            result = true;
            return(result);
        }