Class Array<T>
Strongly-typed IList<T> that can be converted to a Array VariantValue.
public sealed class Array<T> : IDBusWritable, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IVariantValueConvertable where T : notnull
Type Parameters
TThe type of elements in the array.
- Inheritance
-
Array<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Inherited Members
Remarks
The array becomes read-only after conversion.
Supported element types: byte, bool, short, ushort, int, uint, long, ulong, double, string, ObjectPath, Signature, SafeHandle, VariantValue, Array<T>, Dict<TKey, TValue>, and Struct types.
Constructors
Array()
Initializes a new instance of the Array class.
public Array()
Array(IEnumerable<T>)
Initializes a new instance of the Array class from a collection.
public Array(IEnumerable<T> collection)
Parameters
collectionIEnumerable<T>The collection to copy elements from.
Array(int)
Initializes a new instance of the Array class with the specified capacity.
public Array(int capacity)
Parameters
capacityintThe initial capacity.
Properties
Count
public int Count { get; }
Property Value
this[int]
public T this[int index] { get; set; }
Parameters
indexint
Property Value
- T
Methods
Add(T)
public void Add(T item)
Parameters
itemT
AsVariantValue()
Converts this instance to a VariantValue.
public VariantValue AsVariantValue()
Returns
- VariantValue
The VariantValue representation of this instance.
Clear()
public void Clear()
Contains(T)
public bool Contains(T item)
Parameters
itemT
Returns
CopyTo(T[], int)
public void CopyTo(T[] array, int arrayIndex)
Parameters
arrayT[]arrayIndexint
IndexOf(T)
public int IndexOf(T item)
Parameters
itemT
Returns
Insert(int, T)
public void Insert(int index, T item)
Parameters
indexintitemT
Remove(T)
public bool Remove(T item)
Parameters
itemT
Returns
RemoveAt(int)
public void RemoveAt(int index)
Parameters
indexint
Operators
implicit operator VariantValue(Array<T>)
Implicitly converts an Array to a VariantValue.
public static implicit operator VariantValue(Array<T> value)
Parameters
valueArray<T>The array to convert.