Table of Contents

Class Array<T>

Namespace
Tmds.DBus.Protocol
Assembly
Tmds.DBus.Protocol.dll

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

T

The type of elements in the array.

Inheritance
Array<T>
Implements
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

collection IEnumerable<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

capacity int

The initial capacity.

Properties

Count

public int Count { get; }

Property Value

int

this[int]

public T this[int index] { get; set; }

Parameters

index int

Property Value

T

Methods

Add(T)

public void Add(T item)

Parameters

item T

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

item T

Returns

bool

CopyTo(T[], int)

public void CopyTo(T[] array, int arrayIndex)

Parameters

array T[]
arrayIndex int

IndexOf(T)

public int IndexOf(T item)

Parameters

item T

Returns

int

Insert(int, T)

public void Insert(int index, T item)

Parameters

index int
item T

Remove(T)

public bool Remove(T item)

Parameters

item T

Returns

bool

RemoveAt(int)

public void RemoveAt(int index)

Parameters

index int

Operators

implicit operator VariantValue(Array<T>)

Implicitly converts an Array to a VariantValue.

public static implicit operator VariantValue(Array<T> value)

Parameters

value Array<T>

The array to convert.

Returns

VariantValue