In This Article

UIElementCollection Class

Encapsulates a collection of IUIElement items.

[TypeConverter(typeof(UIElementCollectionConverter))]
public class UIElementCollection : LogicalTreeNodeCollection, IDisposable
Inheritance:
object MarshalByRefObject DisposableObject LogicalTreeNodeCollection object
Derived:
BarCommandLinkCollection DockableToolBarRowCollection DockableToolBarRowDockableToolBarCollection StatusBarPanelCollection AutoHideTabCollection AutoHideTabGroupCollection
Implements:
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.

See Also

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

bool:

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

See Also

Dispose(bool)

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

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

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.

See Also

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

int:

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

See Also

OnObjectAdded(int, 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 int

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.

See Also

OnObjectRemoved(int, 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 int

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.

See Also

OnObjectRemoving(int, 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 int

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.

See Also

Inherited Members

See Also