bool ICollection <IExtension> .Remove(IExtension item)
        {
            var ret = this.list.Remove(item);

            if (ret)
            {
                item.Detach(this.owner);
            }

            return(ret);
        }
 public bool Remove(IExtension <T> item)
 {
     lock (this.syncRoot)
     {
         int local_2 = this.items.IndexOf(item);
         if (local_2 >= 0)
         {
             item.Detach(this.owner);
             this.items.RemoveAt(local_2);
         }
         return(false);
     }
 }
Example #3
0
        /// <summary>
        /// 移除扩展点
        /// </summary>
        /// <param name="extension"></param>
        public void Remove(IExtension <T> extension)
        {
            if (extension == null)
            {
                throw new ArgumentNullException("extension");
            }

            lock (Mutex)
            {
                if (!items.Contains(extension))
                {
                    throw new ArgumentException("No contain the extension!");
                }

                extension.Detach(this as T);
                items.Remove(extension);
            }
        }
Example #4
0
        public void Detach(IOperationContext owner)
        {
            OperationContext operationContext = (OperationContextWrap)owner;

            _underlyingObject.Detach(operationContext);
        }