> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class AttributeCollection

Namespace: [VM.Managed](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed)\
Assembly: VMAppCore.dll

This class is to represent the attribute collection.

```csharp theme={null}
public sealed class AttributeCollection : LinkContainer, IObservableObject, IDisposableObject, ILinkable, IObject, ILinkContainer, IOwned, IHasID, IEventProvider, ILinkContainerEvent, IVerifiable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
ObservableObject ←
LinkableBase ←
[LinkContainer](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md) ←
[AttributeCollection](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.AttributeCollection.md)

#### Implements

IObservableObject,
IDisposableObject,
ILinkable,
IObject,
ILinkContainer,
IOwned,
IHasID,
IEventProvider,
[ILinkContainerEvent](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.ILinkContainerEvent.md),
[IVerifiable](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.IVerifiable.md)

#### Inherited Members

[LinkContainer.SetModified()](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_SetModified),
[LinkContainer.raise\_OnUpdating(object, LinkEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_raise_OnUpdating_System_Object_VM_Managed_LinkEventArgs_),
[LinkContainer.raise\_OnUpdate(object, LinkEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_raise_OnUpdate_System_Object_VM_Managed_LinkEventArgs_),
[LinkContainer.raise\_OnDestroying(object, LinkEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_raise_OnDestroying_System_Object_VM_Managed_LinkEventArgs_),
[LinkContainer.raise\_OnDestroy(object, LinkEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_raise_OnDestroy_System_Object_VM_Managed_LinkEventArgs_),
[LinkContainer.raise\_OnAdded(object, AddToDocEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_raise_OnAdded_System_Object_VM_Managed_AddToDocEventArgs_),
[LinkContainer.raise\_OnRemoved(object, RemoveFromDocEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_raise_OnRemoved_System_Object_VM_Managed_RemoveFromDocEventArgs_),
[LinkContainer.GetTargetListForUpdate()](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_GetTargetListForUpdate),
[LinkContainer.SkipUpdateObjectImpl()](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_SkipUpdateObjectImpl),
[LinkContainer.Initialize(Unit.ConvertFactor)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_Initialize_VM_Unit_ConvertFactor_),
[LinkContainer.SetFlagWhenXMLFile(string, bool)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_SetFlagWhenXMLFile_System_String_System_Boolean_),
[LinkContainer.SetContainer(IOwned, bool)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_SetContainer_VM_Models_Pre_IOwned_System_Boolean_),
[LinkContainer.Container](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_Container),
[LinkContainer.Owner](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_Owner),
[LinkContainer.Document](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_Document),
[LinkContainer.ID](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_ID),
[LinkContainer.IsChildExternable](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_IsChildExternable),
[LinkContainer.IsExternable](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_IsExternable),
[LinkContainer.OnRemoved](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_OnRemoved),
[LinkContainer.OnAdded](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_OnAdded),
[LinkContainer.OnDestroy](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_OnDestroy),
[LinkContainer.OnDestroying](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_OnDestroying),
[LinkContainer.OnUpdate](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_OnUpdate),
[LinkContainer.OnUpdating](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkContainer.md#VM_Managed_LinkContainer_OnUpdating),
ObservableObject.Dispose(),
ObservableObject.RaisePropertyChanged(string),
ObservableObject.RaisePropertyChanged(string, object, object),
ObservableObject.IsDisposed,
ObservableObject.TryDisposing,
ObservableObject.Disposed,
ObservableObject.Disposing,
ObservableObject.PropertyChanged

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkedObjects\<T>(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Constructors

### AttributeCollection()

Initializes a new instance of the [AttributeCollection](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.AttributeCollection.md) class.

```csharp theme={null}
public AttributeCollection()
```

## Properties

### Count

Gets the number of elements contained in the ICollection\`1.

```csharp theme={null}
public int Count { get; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### IsExternable

Gets a value indicating whether this instance is Externable.

```csharp theme={null}
public override bool IsExternable { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Keys

Gets an ICollection`1 containing the keys of the IDictionary`2.

```csharp theme={null}
public ICollection<string> Keys { get; }
```

#### Property Value

[ICollection](https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)>

### Values

Gets an ICollection`1 containing the values in the IDictionary`2.

```csharp theme={null}
public ICollection<AttributeBase> Values { get; }
```

#### Property Value

[ICollection](https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1)\<[AttributeBase](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.AttributeBase.md)>

### this\[string]

```csharp theme={null}
public AttributeBase this[string key] { get; set; }
```

#### Property Value

[AttributeBase](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.AttributeBase.md)

## Methods

### Add(string, AttributeBase)

Adds an element with the provided key and value to the IDictionary\`2.

```csharp theme={null}
public void Add(string strKey, AttributeBase attr)
```

#### Parameters

`strKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

The object to use as the key of the element to add.

`attr` [AttributeBase](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.AttributeBase.md)

The object to use as the value of the element to add.

#### Exceptions

[ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`strKey` is null.

[ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception)

An element with the same key already exists in the IDictionary\`2.

[NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception)

The IDictionary\`2 is read-only.

### Clear()

Removes all items from the ICollection\`1.

```csharp theme={null}
public void Clear()
```

#### Exceptions

[NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception)

The ICollection\`1 is read-only.

### ContainsKey(string)

Determines whether the IDictionary\`2 contains an element with the specified key.

```csharp theme={null}
public bool ContainsKey(string strKey)
```

#### Parameters

`strKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

The key to locate in the IDictionary\`2.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if the IDictionary\`2 contains an element with the key; otherwise, false.

#### Exceptions

[ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`strKey` is null.

### GetEnumerator()

Returns an enumerator that iterates through the collection.

```csharp theme={null}
public IEnumerator<KeyValuePair<string, AttributeBase>> GetEnumerator()
```

#### Returns

[IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1)\<[KeyValuePair](https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2)\<[string](https://learn.microsoft.com/dotnet/api/system.string), [AttributeBase](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.AttributeBase.md)>>

A IEnumerator\`1 that can be used to iterate through the collection.

### GetSchema()

This method is reserved and should not be used. When implementing the IXmlSerializable interface,
you should return nullNothingnullptra null reference (Nothing in Visual Basic) (Nothing in Visual Basic)
from this method, and instead, if specifying a custom schema is required,
apply the XmlSchemaProviderAttribute to the class.

```csharp theme={null}
public XmlSchema GetSchema()
```

#### Returns

[XmlSchema](https://learn.microsoft.com/dotnet/api/system.xml.schema.xmlschema)

An XmlSchema that describes the XML representation of the object that is produced by the WriteXml() method and consumed by the ReadXml() method.

### LinkRequestDestroy(object, LinkEventArgs)

Request for destroy the linked object.

```csharp theme={null}
protected override sealed void LinkRequestDestroy(object obNotifier, LinkEventArgs arg)
```

#### Parameters

`obNotifier` [object](https://learn.microsoft.com/dotnet/api/system.object)

The linked object.

`arg` [LinkEventArgs](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkEventArgs.md)

The [LinkEventArgs](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkEventArgs.md) instance containing the event data.

### LinkRequestUpdate(object, LinkEventArgs)

Request for update the linked object.

```csharp theme={null}
protected override sealed void LinkRequestUpdate(object obNotifier, LinkEventArgs arg)
```

#### Parameters

`obNotifier` [object](https://learn.microsoft.com/dotnet/api/system.object)

The linked object.

`arg` [LinkEventArgs](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkEventArgs.md)

The [LinkEventArgs](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.LinkEventArgs.md) instance containing the event data.

### ReadXml(XmlReader)

Generates an object from its XML representation.

```csharp theme={null}
public void ReadXml(XmlReader reader)
```

#### Parameters

`reader` [XmlReader](https://learn.microsoft.com/dotnet/api/system.xml.xmlreader)

The XmlReader stream from which the object is deserialized.

### Remove(string)

Removes the element with the specified key from the IDictionary\`2.

```csharp theme={null}
public bool Remove(string strKey)
```

#### Parameters

`strKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

The key of the element to remove.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if the element is successfully removed; otherwise, false.  This method also returns false if `strKey` was not found in the original IDictionary\`2.

#### Exceptions

[ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`strKey` is null.

[NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception)

The IDictionary\`2 is read-only.

### TryGetValue(string, out AttributeBase)

Gets the value associated with the specified key.

```csharp theme={null}
public bool TryGetValue(string strKey, out AttributeBase value)
```

#### Parameters

`strKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

The key whose value to get.

`value` [AttributeBase](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r2/lib/VM.Managed.AttributeBase.md)

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the `value` parameter. This parameter is passed uninitialized.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if the object that implements IDictionary\`2 contains an element with the specified key; otherwise, false.

#### Exceptions

[ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`strKey` is null.

### WriteXml(XmlWriter)

Converts an object into its XML representation.

```csharp theme={null}
public void WriteXml(XmlWriter writer)
```

#### Parameters

`writer` [XmlWriter](https://learn.microsoft.com/dotnet/api/system.xml.xmlwriter)

The XmlWriter stream to which the object is serialized.
