ObjectTags

Defines the collection of Mechanical’s tags.

Declaration Syntax

public class ObjectTags : IReadOnlyList<ObjectTag>, IReadOnlyCollection<ObjectTag>, IEnumerable<ObjectTag>, IEnumerable, ICollection<ObjectTag>

Table 30: Members

Property

Count

The number of tags in the collection.

Property

Item

Retrieves the tag in the collection at the given index.

Property

Item

Retrieves the tag in the collection with the given name

Property

TagNames

The names of the tags in the collection.

Method

Add(ObjectTag)

Adds a new tag to the collection. Throws an error if the tag already exists in the collection.

Method

Clear()

Clears the collection, removing all objects from the tags in the collection.

Method

Contains(ObjectTag)

Returns whether or not the collection contains the given tag.

Method

GetTag(string)

Returns the tag in the collection with the given name.

Method

IndexOf(ObjectTag)

Returns the index of the given tag. If the given tag does not exist in the collection, returns -1.

Method

Remove(ObjectTag)

Removes a tag if it exists in the collection.

Method

RemoveAt(int)

Removes the tag at the given index from the collection.