protected override void Validate(RemoteServerChildObject objectValue) { if (!(objectValue is RemoteServerProcess)) { throw new ServerException(ServerException.Codes.TypedObjectContainer, "RemoteServerProcess"); } }
public void Remove(RemoteServerChildObject tempValue) { lock (this) { InternalRemoveAt(InternalIndexOf(tempValue)); } }
public int IndexOf(RemoteServerChildObject item) { lock (this) { return(InternalIndexOf(item)); } }
protected virtual void Removing(RemoteServerChildObject objectValue, int index) { objectValue.Disposed -= new EventHandler(ObjectDispose); if (_isOwner && !_disowning) { objectValue.Dispose(); } }
protected int InternalIndexOf(RemoteServerChildObject item) { for (int index = 0; index < _count; index++) { if (_items[index] == item) { return(index); } } return(-1); }
public RemoteServerChildObject Disown(RemoteServerChildObject tempValue) { lock (this) { _disowning = true; try { InternalRemoveAt(InternalIndexOf(tempValue)); return(tempValue); } finally { _disowning = false; } } }
public RemoteServerChildObject DisownAt(int index) { lock (this) { RemoteServerChildObject tempValue = _items[index]; _disowning = true; try { InternalRemoveAt(index); return(tempValue); } finally { _disowning = false; } } }
public RemoteServerChildObject SafeDisown(RemoteServerChildObject tempValue) { lock (this) { _disowning = true; try { int index = InternalIndexOf(tempValue); if (index >= 0) { InternalRemoveAt(index); } return(tempValue); } finally { _disowning = false; } } }
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; } }
protected virtual void Adding(RemoteServerChildObject objectValue, int index) { objectValue.Disposed += new EventHandler(ObjectDispose); }
protected virtual void Validate(RemoteServerChildObject objectValue) { }
public bool Contains(RemoteServerChildObject item) { return(IndexOf(item) >= 0); }