Exemplo n.º 1
0
 protected override void Validate(ServerChildObject objectValue)
 {
     if (!(objectValue is ServerPlan))
     {
         throw new ServerException(ServerException.Codes.ServerPlanContainer);
     }
 }
Exemplo n.º 2
0
 public void Remove(ServerChildObject tempValue)
 {
     lock (this)
     {
         InternalRemoveAt(InternalIndexOf(tempValue));
     }
 }
Exemplo n.º 3
0
 public int IndexOf(ServerChildObject item)
 {
     lock (this)
     {
         return(InternalIndexOf(item));
     }
 }
Exemplo n.º 4
0
        protected virtual void Removing(ServerChildObject objectValue, int index)
        {
            objectValue.Disposed -= new EventHandler(ObjectDispose);

            if (_isOwner && !_disowning)
            {
                objectValue.Dispose();
            }
        }
Exemplo n.º 5
0
 protected int InternalIndexOf(ServerChildObject item)
 {
     for (int index = 0; index < _count; index++)
     {
         if (_items[index] == item)
         {
             return(index);
         }
     }
     return(-1);
 }
Exemplo n.º 6
0
 public ServerChildObject Disown(ServerChildObject tempValue)
 {
     lock (this)
     {
         _disowning = true;
         try
         {
             InternalRemoveAt(InternalIndexOf(tempValue));
             return(tempValue);
         }
         finally
         {
             _disowning = false;
         }
     }
 }
Exemplo n.º 7
0
 public ServerChildObject DisownAt(int index)
 {
     lock (this)
     {
         ServerChildObject tempValue = _items[index];
         _disowning = true;
         try
         {
             InternalRemoveAt(index);
             return(tempValue);
         }
         finally
         {
             _disowning = false;
         }
     }
 }
Exemplo n.º 8
0
 public ServerChildObject SafeDisown(ServerChildObject tempValue)
 {
     lock (this)
     {
         _disowning = true;
         try
         {
             int index = InternalIndexOf(tempValue);
             if (index >= 0)
             {
                 InternalRemoveAt(index);
             }
             return(tempValue);
         }
         finally
         {
             _disowning = false;
         }
     }
 }
Exemplo n.º 9
0
        private void InternalSetCapacity(int tempValue)
        {
            if (_items.Length != tempValue)
            {
                ServerChildObject[] newItems = new ServerChildObject[tempValue];
                for (int index = 0; index < ((_count > tempValue) ? tempValue : _count); index++)
                {
                    newItems[index] = _items[index];
                }

                if (_count > tempValue)
                {
                    for (int index = _count - 1; index > tempValue; index--)
                    {
                        InternalRemoveAt(index);
                    }
                }

                _items = newItems;
            }
        }
Exemplo n.º 10
0
 protected virtual void Adding(ServerChildObject objectValue, int index)
 {
     objectValue.Disposed += new EventHandler(ObjectDispose);
 }
Exemplo n.º 11
0
 protected virtual void Validate(ServerChildObject objectValue)
 {
 }
Exemplo n.º 12
0
 public bool Contains(ServerChildObject item)
 {
     return(IndexOf(item) >= 0);
 }