Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​ComponentModel.​AttributeCollection

Assembly: System.ComponentModel.TypeConverter

Inheritance: object → AttributeCollection

Implemented Interfaces

Represents a collection of attributes.

Fields and Constants

public static readonly AttributeCollection
Empty
Specifies an empty collection that you can use, rather than creating a new one. This field is read-only.

Properties

protected Attribute[]
Attributes
Gets the attribute collection.
public int
Count
Gets the number of attributes.
public Attribute
Item
public Attribute
Item

Methods

public bool
Contains​(Attribute attribute)
Determines whether this collection of attributes has the specified attribute.
Returns <see langword="true" /> if the collection contains the attribute or is the default attribute for the type of attribute; otherwise, <see langword="false" /> .
attribute An <see cref="T:System.Attribute" /> to find in the collection.
public bool
Contains​(Attribute[] attributes)
Determines whether this attribute collection contains all the specified attributes in the attribute array.
Returns <see langword="true" /> if the collection contains all the attributes; otherwise, <see langword="false" /> .
attributes An array of type <see cref="T:System.Attribute" /> to find in the collection.
public void
CopyTo​(Array array, int index)
Copies the collection to an array, starting at the specified index.
array The <see cref="T:System.Array" /> to copy the collection to.
index The index to start from.
public static AttributeCollection
FromExisting​(AttributeCollection existing, Attribute[] newAttributes)
Creates a new <see cref="T:System.ComponentModel.AttributeCollection" /> from an existing <see cref="T:System.ComponentModel.AttributeCollection" /> .
Returns A new <see cref="T:System.ComponentModel.AttributeCollection" /> that is a copy of <paramref name="existing" /> .
existing An <see cref="T:System.ComponentModel.AttributeCollection" /> from which to create the copy.
newAttributes An array of type <see cref="T:System.Attribute" /> that provides the attributes for this collection. Can be <see langword="null" /> .
protected Attribute
GetDefaultAttribute​(Type attributeType)
Returns the default <see cref="T:System.Attribute" /> of a given <see cref="T:System.Type" /> .
Returns The default <see cref="T:System.Attribute" /> of a given <paramref name="attributeType" /> .
attributeType The <see cref="T:System.Type" /> of the attribute to retrieve.
GetEnumerator​()
Gets an enumerator for this collection.
Returns An enumerator of type <see cref="T:System.Collections.IEnumerator" /> .
public bool
Matches​(Attribute attribute)
Determines whether a specified attribute is the same as an attribute in the collection.
Returns <see langword="true" /> if the attribute is contained within the collection and has the same value as the attribute in the collection; otherwise, <see langword="false" /> .
attribute An instance of <see cref="T:System.Attribute" /> to compare with the attributes in this collection.
public bool
Matches​(Attribute[] attributes)
Determines whether the attributes in the specified array are the same as the attributes in the collection.
Returns <see langword="true" /> if all the attributes in the array are contained in the collection and have the same values as the attributes in the collection; otherwise, <see langword="false" /> .
attributes An array of <see cref="T:System.CodeDom.MemberAttributes" /> to compare with the attributes in this collection.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object