MySQL · Types · Other public types
ArxAttributeCollection
Definition
- Namespace
ARX.SDK.Services- Package
ARX.SDK
public class ArxAttributeCollection : IEnumerable<KeyValuePair<string, object?>>An entity's attributes: names and their values. Names are kept as given and matched ignoring case, on read and on write: entity["Name"] finds name, and setting entity["Name"] replaces it. A result with two columns whose names differ only in case is refused (ARX1004).
Constructor
ArxAttributeCollection()An empty collection; names are matched ignoring case.
ArxAttributeCollection(IDictionary<string, object?> dictionary)A collection over this dictionary, used as it is (not copied): its comparer decides how names match, so pass one with
OrdinalIgnoreCaseto match the rest of ARX.Parameter Type Description dictionaryIDictionary<string, object?>The attributes to start with; names are matched ignoring case.
Properties
object? this[string key] { get; set; }The value of an attribute;
KeyNotFoundExceptionwhen the collection doesn't have it.int Count { get; }The number of attributes.
ICollection<string> Keys { get; }The attribute names.
ICollection<object?> Values { get; }The attribute values.
Methods
void Add(string key, object? value)Adds an attribute;
ArgumentExceptionwhen one with that name (ignoring case) is there.Parameter Type Description keystringThe attribute name. valueobject?Its value; null writes NULL. void Add(KeyValuePair<string, object?> item)Adds an attribute.
Parameter Type Description itemKeyValuePair<string, object?>The name and value. void AddRange(IEnumerable<KeyValuePair<string, object?>>? items)Adds the attributes.
Parameter Type Description itemsIEnumerable<KeyValuePair<string, object?>>?The names and values; null adds nothing. void AddRange(params KeyValuePair<string, object?>[] items)Adds the attributes.
Parameter Type Description itemsparams KeyValuePair<string, object?>[]The names and values. void Clear()Removes every attribute.
bool Contains(string key)True when an attribute has this name (ignoring case).
Parameter Type Description keystringThe attribute name. bool Contains(KeyValuePair<string, object?> item)True when this name and value are present.
Parameter Type Description itemKeyValuePair<string, object?>The name and value to look for. bool ContainsKey(string key)True when an attribute has this name (ignoring case).
Parameter Type Description keystringThe attribute name. void CopyTo(KeyValuePair<string, object?>[] array, int arrayIndex)Copies the attributes into an array.
Parameter Type Description arrayKeyValuePair<string, object?>[]The array to copy into. arrayIndexintWhere in the array the first attribute goes. bool Remove(string key)Removes the attribute with this name; true when it was there.
Parameter Type Description keystringThe attribute name. bool Remove(KeyValuePair<string, object?> item)Removes this name and value; true when it was there.
Parameter Type Description itemKeyValuePair<string, object?>The name and value to remove. bool TryGetValue(string key, out object? value)Gets an attribute's value; false when the collection doesn't have it.
Parameter Type Description keystringThe attribute name, matched ignoring case. valueout object?The value when found; otherwise null. IEnumerator<KeyValuePair<string, object?>> GetEnumerator()The attributes, as name and value pairs.
Notes
Unlike ArxEntity's indexer, which gives null for a name the entity doesn't have, this collection's indexer throws KeyNotFoundException: use TryGetValue or ContainsKey.