예제 #1
0
 protected override void Validate(RemoteServerChildObject objectValue)
 {
     if (!(objectValue is RemoteServerProcess))
     {
         throw new ServerException(ServerException.Codes.TypedObjectContainer, "RemoteServerProcess");
     }
 }
예제 #2
0
 public void Remove(RemoteServerChildObject tempValue)
 {
     lock (this)
     {
         InternalRemoveAt(InternalIndexOf(tempValue));
     }
 }
예제 #3
0
 public int IndexOf(RemoteServerChildObject item)
 {
     lock (this)
     {
         return(InternalIndexOf(item));
     }
 }
예제 #4
0
        protected virtual void Removing(RemoteServerChildObject objectValue, int index)
        {
            objectValue.Disposed -= new EventHandler(ObjectDispose);

            if (_isOwner && !_disowning)
            {
                objectValue.Dispose();
            }
        }
예제 #5
0
 protected int InternalIndexOf(RemoteServerChildObject item)
 {
     for (int index = 0; index < _count; index++)
     {
         if (_items[index] == item)
         {
             return(index);
         }
     }
     return(-1);
 }
예제 #6
0
 public RemoteServerChildObject Disown(RemoteServerChildObject tempValue)
 {
     lock (this)
     {
         _disowning = true;
         try
         {
             InternalRemoveAt(InternalIndexOf(tempValue));
             return(tempValue);
         }
         finally
         {
             _disowning = false;
         }
     }
 }
예제 #7
0
 public RemoteServerChildObject DisownAt(int index)
 {
     lock (this)
     {
         RemoteServerChildObject tempValue = _items[index];
         _disowning = true;
         try
         {
             InternalRemoveAt(index);
             return(tempValue);
         }
         finally
         {
             _disowning = false;
         }
     }
 }
예제 #8
0
 public RemoteServerChildObject SafeDisown(RemoteServerChildObject tempValue)
 {
     lock (this)
     {
         _disowning = true;
         try
         {
             int index = InternalIndexOf(tempValue);
             if (index >= 0)
             {
                 InternalRemoveAt(index);
             }
             return(tempValue);
         }
         finally
         {
             _disowning = false;
         }
     }
 }
예제 #9
0
        private void InternalSetCapacity(int tempValue)
        {
            if (_items.Length != tempValue)
            {
                RemoteServerChildObject[] newItems = new RemoteServerChildObject[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;
            }
        }
예제 #10
0
 protected virtual void Adding(RemoteServerChildObject objectValue, int index)
 {
     objectValue.Disposed += new EventHandler(ObjectDispose);
 }
예제 #11
0
 protected virtual void Validate(RemoteServerChildObject objectValue)
 {
 }
예제 #12
0
 public bool Contains(RemoteServerChildObject item)
 {
     return(IndexOf(item) >= 0);
 }