Remove() private method

private Remove ( ) : void
return void
Example #1
0
 public void Remove(int itemIndex)
 {
     if (this.isClosed)
     {
         throw new JSVsaException(JSVsaError.EngineClosed);
     }
     this.TryObtainLock();
     try
     {
         if ((0 > itemIndex) || (itemIndex >= this.items.Count))
         {
             throw new JSVsaException(JSVsaError.ItemNotFound);
         }
         VsaItem item = (VsaItem)this.items[itemIndex];
         item.Remove();
         this.items.RemoveAt(itemIndex);
         if (item is VsaStaticCode)
         {
             this.staticCodeBlockCount--;
         }
     }
     finally
     {
         this.ReleaseLock();
     }
 }
 public virtual void RemoveItem(IVsaItem item)
 {
     for (int i = 0, n = this.items.Count; i < n; i++)
     {
         VsaItem vsaItem = (VsaItem)this.items[i];
         if (vsaItem == item)
         {
             vsaItem.Remove();
             this.items.Remove(i);
             return;
         }
     }
     throw new VsaException(VsaError.ItemNotFound);
 }
 public virtual void RemoveItem(string itemName)
 {
     for (int i = 0, n = this.items.Count; i < n; i++)
     {
         VsaItem item = (VsaItem)this.items[i];
         if (null == item.Name && null == itemName || null != item.Name && item.Name.Equals(itemName))
         {
             item.Remove();
             this.items.Remove(i);
             return;
         }
     }
     throw new VsaException(VsaError.ItemNotFound);
 }
Example #4
0
        public virtual void RemoveItem(string itemName)
        {
            int num   = 0;
            int count = this.items.Count;

            while (num < count)
            {
                VsaItem item = (VsaItem)this.items[num];
                if (((item.Name == null) && (itemName == null)) || ((item.Name != null) && item.Name.Equals(itemName)))
                {
                    item.Remove();
                    this.items.Remove(num);
                    return;
                }
                num++;
            }
            throw new JSVsaException(JSVsaError.ItemNotFound);
        }
Example #5
0
        public virtual void RemoveItem(IJSVsaItem item)
        {
            int num   = 0;
            int count = this.items.Count;

            while (num < count)
            {
                VsaItem item2 = (VsaItem)this.items[num];
                if (item2 == item)
                {
                    item2.Remove();
                    this.items.Remove(num);
                    return;
                }
                num++;
            }
            throw new JSVsaException(JSVsaError.ItemNotFound);
        }
Example #6
0
 public virtual void Remove(int itemIndex)
 {
     if (this.isClosed)
     {
         throw new VsaException(VsaError.EngineClosed);
     }
     this.TryObtainLock();
     try{
         if (0 <= itemIndex && itemIndex < items.Count)
         {
             VsaItem item = (VsaItem)this.items[itemIndex];
             item.Remove();
             this.items.RemoveAt(itemIndex);
             if (item is VsaStaticCode)
             {
                 this.staticCodeBlockCount--;
             }
             return;
         }
         throw new VsaException(VsaError.ItemNotFound);
     }finally{
         this.ReleaseLock();
     }
 }