Beispiel #1
0
 internal void AddPart(IIdentifiablePart p)
 {
     if (this.myParts == null)
     {
         this.myParts = new Hashtable(1000);
     }
     int num1 = p.PartID;
     if (num1 == -1)
     {
         int num3;
         this.myLastPartID = num3 = this.myLastPartID + 1;
         int num2 = num3;
         while (this.myParts[num2] != null)
         {
             this.myLastPartID = num3 = this.myLastPartID + 1;
             num2 = num3;
         }
         this.myParts[num2] = p;
         p.PartID = num2;
     }
     else
     {
         IIdentifiablePart part1 = (IIdentifiablePart)this.myParts[num1];
         if (part1 == null)
         {
             this.myParts[num1] = p;
         }
         else if (part1.PartID != num1)
         {
             this.myParts[num1] = p;
             part1.PartID = -1;
             this.AddPart(part1);
         }
     }
 }
Beispiel #2
0
 internal void RemovePart(IIdentifiablePart p)
 {
     if (this.myParts != null)
     {
         this.myParts.Remove(p.PartID);
     }
 }