Example #1
0
 private void m0000b4(c000068 p0)
 {
     c000072.m0000bf(this);
     string str = null;
     if (this.f00000f != -1)
     {
         c000112 item = c000070.f000017;
         struct0171 reorderValues = new struct0171();
         reorderValues.f000017 = item;
         reorderValues.f000110 = item.f000017;
         if (item.f000017 == null)
         {
             reorderValues.f00000b = this.f00005b.IndexOf(item);
         }
         else
         {
             reorderValues.f00000b = item.f000017.f00005b.IndexOf(item);
         }
         reorderValues.f000111 = reorderValues.f000110;
         if (reorderValues.f000110 != null)
         {
             int index = reorderValues.f000110.f00005b.IndexOf(reorderValues.f000017);
             c000112 c2 = this.m0003d0(Math.Max(this.f00000f, 0));
             bool flag = false;
             if (c2 == null)
             {
                 if ((this.f00000f != 0) && (this.f00005b.Count != 0))
                 {
                     int num2 = this.f00000f;
                     while ((num2 > 0) && (c2 == null))
                     {
                         num2--;
                         c2 = this.m0003d0(Math.Max(num2, 0));
                         flag = true;
                     }
                 }
                 else
                 {
                     c2 = reorderValues.f000017;
                 }
             }
             bool flag2 = false;
             while (c2.m00000f() > item.m00000f())
             {
                 c2 = c2.f000017;
                 flag2 = true;
             }
             if ((c2.m00000f() < item.m00000f()) && (c2 != item.f000017))
             {
                 c000112 c3 = this.m0003d0(this.f00000f - 1);
                 if ((c3 != null) && c3.m000202(reorderValues.f000110))
                 {
                     this.f00000f = item.f000017.f00005b.Count - 1;
                 }
                 else
                 {
                     str = "Could not reorder list.  The new parent is not at the same depth.";
                 }
             }
             else if ((c2 != reorderValues.f000110) && (c2.f000017 != reorderValues.f000110))
             {
                 str = "Cannot move item to a different list.";
             }
             else
             {
                 int num3 = 0;
                 if (c2.f000017 != null)
                 {
                     num3 = c2.f000017.f00005b.IndexOf(c2);
                 }
                 if (flag2)
                 {
                     num3++;
                 }
                 if (!((num3 <= reorderValues.f00000b) || flag))
                 {
                     num3--;
                 }
                 this.f00000f = num3;
             }
             if (str == null)
             {
                 reorderValues.f000110.f00005b.Remove(reorderValues.f000017);
                 reorderValues.f00000f = this.f00000f;
                 reorderValues.f00000f = Math.Max(0, reorderValues.f00000f);
                 reorderValues.f00000f = Math.Min(reorderValues.f000110.f00005b.Count, reorderValues.f00000f);
                 reorderValues.f000110.f00005b.Insert(reorderValues.f00000f, reorderValues.f000017);
             }
         }
         else
         {
             reorderValues.f00000f = this.f00000f;
             using (List<c000112>.Enumerator enumerator = this.f00005b.GetEnumerator())
             {
             Label_0365:
                 if (enumerator.MoveNext())
                 {
                     c000112 current = enumerator.Current;
                     if (this.m0003da(current) < this.f00000f)
                     {
                         goto Label_0365;
                     }
                     reorderValues.f00000f = this.f00005b.IndexOf(current);
                 }
             }
             if (reorderValues.f00000f > reorderValues.f00000b)
             {
                 reorderValues.f00000f--;
                 reorderValues.f00000f = Math.Min(reorderValues.f00000f, this.f00005b.Count - 1);
             }
             this.f00005b.Remove(reorderValues.f000017);
             this.f00005b.Insert(reorderValues.f00000f, reorderValues.f000017);
         }
         if (str != null)
         {
             c000070.m0000a9(str, "Error reordering");
         }
         if ((this.f00088c != null) && ((reorderValues.f000110 != reorderValues.f000111) || (reorderValues.f00000b != reorderValues.f00000f)))
         {
             this.f00088c(reorderValues);
         }
     }
 }
Example #2
0
 private void m0000c2(struct0171 p0)
 {
     if (p0.f000110 == p0.f000111)
     {
         IList list;
         if (p0.f000110 != null)
         {
             if (p0.f000110.f00000e is IList)
             {
                 list = p0.f000110.f00000e as IList;
                 list.Remove(p0.f000017.f00000e);
                 list.Insert(p0.f00000f, p0.f000017.f00000e);
             }
         }
         else
         {
             list = this.f000894;
             if (list != null)
             {
                 list.RemoveAt(p0.f00000b);
                 list.Insert(p0.f00000f, p0.f000017.f00000e);
             }
         }
     }
 }