Class AttributeCollection
Last update: 16.07.2025Namespace: VM.Managed
Assembly: VMAppCore.dll
This class is to represent the attribute collection.
public sealed class AttributeCollection : LinkContainer, IObservableObject, IDisposableObject, ILinkable, IObject, ILinkContainer, IOwned, IHasID, IEventProvider, ILinkContainerEvent, IVerifiable
Inheritance
object ← ObservableObject ← LinkableBase ← LinkContainer ← AttributeCollection
Implements
IObservableObject, IDisposableObject, ILinkable, IObject, ILinkContainer, IOwned, IHasID, IEventProvider, ILinkContainerEvent, IVerifiable
Inherited Members
LinkContainer.SetModified(), LinkContainer.raise_OnUpdating(object, LinkEventArgs), LinkContainer.raise_OnUpdate(object, LinkEventArgs), LinkContainer.raise_OnDestroying(object, LinkEventArgs), LinkContainer.raise_OnDestroy(object, LinkEventArgs), LinkContainer.raise_OnAdded(object, AddToDocEventArgs), LinkContainer.raise_OnRemoved(object, RemoveFromDocEventArgs), LinkContainer.GetTargetListForUpdate(), LinkContainer.SkipUpdateObjectImpl(), LinkContainer.Initialize(Unit.ConvertFactor), LinkContainer.SetFlagWhenXMLFile(string, bool), LinkContainer.SetContainer(IOwned, bool), LinkContainer.Container, LinkContainer.Owner, LinkContainer.Document, LinkContainer.ID, LinkContainer.IsChildExternable, LinkContainer.IsExternable, LinkContainer.OnRemoved, LinkContainer.OnAdded, LinkContainer.OnDestroy, LinkContainer.OnDestroying, LinkContainer.OnUpdate, 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),
LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType),
LinkPropertyItemCache.GetLinkedObjects
Constructors
AttributeCollection()
Initializes a new instance of the
public AttributeCollection()
Properties
Count
Gets the number of elements contained in the
public int Count { get; }
Property Value
IsExternable
Gets a value indicating whether this instance is Externable.
public override bool IsExternable { get; }
Property Value
Keys
Gets an
public ICollection<string> Keys { get; }
Property Value
Values
Gets an
public ICollection<attributebase> Values { get; }
Property Value
this[string]
public AttributeBase this[string key] { get; set; }
Property Value
Methods
Add(string, AttributeBase)
Adds an element with the provided key and value to the
public void Add(string strKey, AttributeBase attr)
Parameters
strKey string
The object to use as the key of the element to add.
attr AttributeBase
The object to use as the value of the element to add.
Exceptions
strKey is null.
An element with the same key already exists in the
The
Clear()
Removes all items from the
public void Clear()
Exceptions
The
ContainsKey(string)
Determines whether the
public bool ContainsKey(string strKey)
Parameters
strKey string
The key to locate in the
Returns
true if the
Exceptions
strKey is null.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<keyvaluepair><string attributebase>> GetEnumerator()
Returns
IEnumeratorKeyValuePairstring, AttributeBase>>
A
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.
public XmlSchema GetSchema()
Returns
An
LinkRequestDestroy(object, LinkEventArgs)
Request for destroy the linked object.
protected override sealed void LinkRequestDestroy(object obNotifier, LinkEventArgs arg)
Parameters
obNotifier object
The linked object.
arg LinkEventArgs
The
LinkRequestUpdate(object, LinkEventArgs)
Request for update the linked object.
protected override sealed void LinkRequestUpdate(object obNotifier, LinkEventArgs arg)
Parameters
obNotifier object
The linked object.
arg LinkEventArgs
The
ReadXml(XmlReader)
Generates an object from its XML representation.
public void ReadXml(XmlReader reader)
Parameters
reader XmlReader
The XmlReader stream from which the object is deserialized.
Remove(string)
Removes the element with the specified key from the
public bool Remove(string strKey)
Parameters
strKey string
The key of the element to remove.
Returns
true if the element is successfully removed; otherwise, false. This method also returns false if strKey was not found in the original
Exceptions
strKey is null.
The
TryGetValue(string, out AttributeBase)
Gets the value associated with the specified key.
public bool TryGetValue(string strKey, out AttributeBase value)
Parameters
strKey string
The key whose value to get.
value AttributeBase
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
true if the object that implements
Exceptions
strKey is null.
WriteXml(XmlWriter)
Converts an object into its XML representation.
public void WriteXml(XmlWriter writer)
Parameters
writer XmlWriter
The XmlWriter stream to which the object is serialized.