In This Article

UIElementCollection Class

Encapsulates a collection of IUIElement items.

public class UIElementCollection : LogicalTreeNodeCollection, IDisposable, IList, ICollection, IEnumerable
Inheritance:
Object MarshalByRefObject DisposableObject LogicalTreeNodeCollection Object
Derived:
BarCommandLinkCollection DockableToolBarRowCollection DockableToolBarRowDockableToolBarCollection StatusBarPanelCollection AutoHideTabCollection AutoHideTabGroupCollection
Implements:
System.IDisposable

Remarks

This class is a zero-based indexed collection.

Constructors

UIElementCollection(IUIElement)

Initializes a new instance of the UIElementCollection class.

public UIElementCollection(IUIElement owner)
Parameter Type Description
owner IUIElement

The owner of the collection.

Properties

PluralElementName

Gets the short, plural name of the type of child elements in the collection.

protected virtual string PluralElementName { get; }

Property Value

String:

The short, plural name of the type of child elements in the collection.

Remarks

This value is used within the design-time environment when indicating the count of elements in the collection.

See Also

SingularElementName

Gets the short, singular name of the type of child elements in the collection.

protected virtual string SingularElementName { get; }

Property Value

String:

The short, singular name of the type of child elements in the collection.

Remarks

This value is used within the design-time environment when indicating the count of elements in the collection.

See Also

Methods

Contains(IUIElement)

Determines whether the specified element is in the collection.

public bool Contains(IUIElement value)
Parameter Type Description
value IUIElement

The IUIElement to look for.

Returns

Boolean:

true if the collection contains the element; otherwise, false.

Dispose(Boolean)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected override void Dispose(bool disposing)
Parameter Type Description
disposing Boolean

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes this method with the disposing parameter set to true. Finalize invokes this method with disposing set to false.

IndexOf(IUIElement)

Returns the index of the specified element in the collection.

public int IndexOf(IUIElement value)
Parameter Type Description
value IUIElement

The IUIElement to look for.

Returns

Int32:

If found, the index where the element is in the collection; otherwise, -1.

OnObjectAdded(Int32, ILogicalTreeNode)

Performs additional custom processes after an object is added to the collection.

protected override void OnObjectAdded(int index, ILogicalTreeNode value)
Parameter Type Description
index Int32

The zero-based index at which the object was inserted.

value ILogicalTreeNode

The object that was inserted.

Remarks

The default implementation of this method is intended to be overridden by a derived class to perform some action after the specified object is added.

OnObjectRemoved(Int32, ILogicalTreeNode)

Performs additional custom processes after an object is removed from the collection.

protected override void OnObjectRemoved(int index, ILogicalTreeNode value)
Parameter Type Description
index Int32

The zero-based index from which the object was removed.

value ILogicalTreeNode

The object that was removed.

Remarks

The default implementation of this method is intended to be overridden by a derived class to perform some action after the specified object is removed.

OnObjectRemoving(Int32, ILogicalTreeNode)

Performs additional custom processes before an object is removed from the collection.

protected override void OnObjectRemoving(int index, ILogicalTreeNode value)
Parameter Type Description
index Int32

The zero-based index from which the object was removed.

value ILogicalTreeNode

The object that was removed.

Remarks

The default implementation of this method is intended to be overridden by a derived class to perform some action before the specified object is removed.

Inherited Members

See Also