KeyedLogicalTreeNodeCollection Class
Provides a base collection class for objects that implement IKeyedLogicalTreeNode.
public class KeyedLogicalTreeNodeCollection : LogicalTreeNodeCollection, IDisposable
- Inheritance:
- object MarshalByRefObject DisposableObject LogicalTreeNodeCollection object
- Implements:
- IDisposable
Constructors
KeyedLogicalTreeNodeCollection(ILogicalTreeNode)
Initializes a new instance of the KeyedLogicalTreeNodeCollection
class.
public KeyedLogicalTreeNodeCollection(ILogicalTreeNode owner)
Parameter | Type | Description |
---|---|---|
owner | ILogicalTreeNode | The owner of the collection. |
Properties
AllowDuplicateKeys
Gets whether duplicate keys are permitted within the collection.
public virtual bool AllowDuplicateKeys { get; }
Property Value
- bool:
true
if duplicate keys are permitted; otherwise,false
.
AllowEmptyKeys
Gets whether empty keys are permitted within the collection.
public virtual bool AllowEmptyKeys { get; }
Property Value
- bool:
true
if empty keys are permitted; otherwise,false
.
Methods
Contains(string)
Determines whether a key is in the collection.
public virtual bool Contains(string key)
Parameter | Type | Description |
---|---|---|
key | string | The key to locate in the collection. |
Returns
- bool:
true
if the key is found in the collection; otherwise,false
.
IndexOf(string)
Searches for the specified key and returns the zero-based index of the first occurrence within the entire collection.
public virtual int IndexOf(string key)
Parameter | Type | Description |
---|---|---|
key | string | The key to locate in the collection. |
Returns
- int:
The zero-based index of the first occurrence of the key within the entire collection, if found; otherwise,
-1
.
OnValidate(ILogicalTreeNode, int)
Performs additional custom processes when validating a value.
protected override void OnValidate(ILogicalTreeNode value, int existingIndex)
Parameter | Type | Description |
---|---|---|
value | ILogicalTreeNode | The object to validate. |
existingIndex | int | The index within the collection of the object that would be replaced by the value. |
Remarks
The default implementation of this method determines whether value is null
, and if so,
throws ArgumentNullException.
It also implements rules defined by AllowEmptyKeys and AllowDuplicateKeys.
It is intended to be overridden by a derived class to perform additional action when the specified element is validated.
Inherited Members
- LogicalTreeNodeCollection.AddCore(ILogicalTreeNode)
- LogicalTreeNodeCollection.ClearCore()
- LogicalTreeNodeCollection.Contains(ILogicalTreeNode)
- LogicalTreeNodeCollection.CopyTo(Array, int)
- LogicalTreeNodeCollection.Dispose(bool)
- LogicalTreeNodeCollection.DisposeAllChildObjects()
- LogicalTreeNodeCollection.GetEnumerator()
- LogicalTreeNodeCollection.IndexOf(ILogicalTreeNode)
- LogicalTreeNodeCollection.InsertCore(int, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectAdding(int, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectAdded(int, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectRemoving(int, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectRemoved(int, ILogicalTreeNode)
- LogicalTreeNodeCollection.RemoveCore(ILogicalTreeNode)
- LogicalTreeNodeCollection.RemoveAllOfTypeCore(Type)
- LogicalTreeNodeCollection.RemoveAtCore(int)
- LogicalTreeNodeCollection.SetCore(int, ILogicalTreeNode)
- LogicalTreeNodeCollection.AutoAssignParent
- LogicalTreeNodeCollection.Count
- LogicalTreeNodeCollection.InnerList
- LogicalTreeNodeCollection.IsFixedSize
- LogicalTreeNodeCollection.IsReadOnly
- LogicalTreeNodeCollection.IsSynchronized
- LogicalTreeNodeCollection.OwnerCore
- LogicalTreeNodeCollection.SyncRoot
- LogicalTreeNodeCollection.ObjectAdding
- LogicalTreeNodeCollection.ObjectAdded
- LogicalTreeNodeCollection.ObjectRemoving
- LogicalTreeNodeCollection.ObjectRemoved
- DisposableObject.Dispose()
- DisposableObject.VerifyNotDisposed()
- DisposableObject.IsDisposed
- DisposableObject.Disposed
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.MemberwiseClone(bool)
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()