示例#1
0
 /// <summary>
 /// Remove Mobile with specified serial.
 /// </summary>
 /// <returns>True if Mobile is found and removed.</returns>
 public bool Remove(int serial)
 {
     lock (mySyncRoot)
     {
         Mobile m;
         if (myMobileList.TryGetValue(serial, out m))
         {
             myMobileList.Remove(serial);
             //myLinkedItemCollection.RemoveByOwner(serial);
             foreach (int s in m.GetAllLayers())
             {
                 if (s != 0)
                 {
                     myLinkedItemCollection.Remove(s);
                 }
             }
             this.OnCollectionChanged();
             return(true);
         }
     }
     return(false);
 }