KeyedLogicalTreeNodeCollection Class
Provides a base collection class for objects that implement IKeyedLogicalTreeNode.
public class KeyedLogicalTreeNodeCollection : LogicalTreeNodeCollection, IDisposable, IList, ICollection, IEnumerable
- 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
- Boolean:
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
- Boolean:
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
- Boolean:
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
- Int32:
The zero-based index of the first occurrence of the key within the entire collection, if found; otherwise,
-1
.
OnValidate(ILogicalTreeNode, Int32)
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 | Int32 | 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, Int32)
- LogicalTreeNodeCollection.Dispose(Boolean)
- LogicalTreeNodeCollection.DisposeAllChildObjects()
- LogicalTreeNodeCollection.GetEnumerator()
- LogicalTreeNodeCollection.IndexOf(ILogicalTreeNode)
- LogicalTreeNodeCollection.InsertCore(Int32, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectAdding(Int32, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectAdded(Int32, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectRemoving(Int32, ILogicalTreeNode)
- LogicalTreeNodeCollection.OnObjectRemoved(Int32, ILogicalTreeNode)
- LogicalTreeNodeCollection.RemoveCore(ILogicalTreeNode)
- LogicalTreeNodeCollection.RemoveAllOfTypeCore(Type)
- LogicalTreeNodeCollection.RemoveAtCore(Int32)
- LogicalTreeNodeCollection.SetCore(Int32, 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.MemberwiseClone(Boolean)
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.CreateObjRef(Type)
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()