Table of Contents

Class PropertyStore

Namespace
NAudio.CoreAudioApi
Assembly
NAudio.Wasapi.dll

Property Store class, only supports reading properties at the moment.

public class PropertyStore : IDisposable
Inheritance
PropertyStore
Implements
Inherited Members

Properties

Count

Property Count

public int Count { get; }

Property Value

int

this[PropertyKey]

Indexer by guid

public PropertyStoreProperty this[PropertyKey key] { get; }

Parameters

key PropertyKey

Property Key

Property Value

PropertyStoreProperty

Property or null if not found

this[int]

Gets property by index

public PropertyStoreProperty this[int index] { get; }

Parameters

index int

Property index

Property Value

PropertyStoreProperty

The property

Methods

Commit()

Saves a property change.

public void Commit()

Contains(PropertyKey)

Contains property guid

public bool Contains(PropertyKey key)

Parameters

key PropertyKey

Looks for a specific key

Returns

bool

True if found

Dispose()

Releases the underlying IPropertyStore COM reference.

public void Dispose()

Get(int)

Gets property key at specified index

public PropertyKey Get(int index)

Parameters

index int

Index

Returns

PropertyKey

Property key

GetValue(int)

Gets property value at specified index. The returned struct's pointer-typed fields (LPWSTR/BLOB/CLSID) are not safe to read — use the indexer overloads instead, which resolve the value before clearing the underlying COM-allocated memory.

[Obsolete("Returned PropVariant may contain dangling pointers. Use this[int] which resolves the value safely.")]
public PropVariant GetValue(int index)

Parameters

index int

Index

Returns

PropVariant

Property value

SetValue(PropertyKey, PropVariant)

Sets property value at specified key.

public void SetValue(PropertyKey key, PropVariant value)

Parameters

key PropertyKey

Key of property to set.

value PropVariant

Value to write.

TryGetValue<T>(PropertyKey, out T)

Checks if the property exists

public bool TryGetValue<T>(PropertyKey key, out T obj)

Parameters

key PropertyKey

Looks for a specific key

obj T

The value of the property wrapped in a type cast

Returns

bool

True if found

Type Parameters

T

The type to cast the property as