Class PropertyStore
- Namespace
- AudioDeviceLib.CoreAudioApi
- Assembly
- AudioDeviceLib.dll
Property Store class, only supports reading properties at the moment.
[PublicAPI]
public sealed class PropertyStore : IDisposable
- Inheritance
-
PropertyStore
- Implements
- Inherited Members
Properties
Count
Gets the number of properties in the store.
public int Count { get; }
Property Value
Exceptions
- COMException
Thrown when the underlying Core Audio call fails.
this[PropertyKey]
Gets the property that matches the given key exactly.
public PropertyStoreProperty? this[PropertyKey queryKey] { get; }
Parameters
queryKeyPropertyKeyThe property key (set GUID and property id) to look up.
Property Value
- PropertyStoreProperty
The matching PropertyStoreProperty, or
nullif none is found.
Exceptions
- COMException
Thrown when the underlying Core Audio call fails.
this[Guid]
Gets the first property whose property set matches the given GUID.
public PropertyStoreProperty? this[Guid formatId] { get; }
Parameters
formatIdGuidThe format identifier (GUID) of the property set to look up.
Property Value
- PropertyStoreProperty
The matching PropertyStoreProperty, or
nullif none is found.
Exceptions
- COMException
Thrown when the underlying Core Audio call fails.
this[int]
Gets the property at the specified zero-based index.
public PropertyStoreProperty this[int index] { get; }
Parameters
Property Value
- PropertyStoreProperty
The PropertyStoreProperty at the requested position.
Exceptions
- COMException
Thrown when the underlying Core Audio call fails.
Methods
Contains(PropertyKey)
Determines whether the store contains a property matching the given key exactly.
public bool Contains(PropertyKey compareKey)
Parameters
compareKeyPropertyKeyThe property key (set GUID and property id) to look for.
Returns
- bool
trueif a matching property exists; otherwisefalse.
Contains(Guid)
Determines whether the store contains any property from the given property set.
public bool Contains(Guid formatId)
Parameters
formatIdGuidThe format identifier (GUID) of the property set to look for.
Returns
- bool
trueif a property with the matching set GUID exists; otherwisefalse.
Dispose()
Invalidates this wrapper without releasing externally held COM references.
public void Dispose()
Get(int)
Gets the property key at the specified zero-based index.
public PropertyKey Get(int index)
Parameters
Returns
- PropertyKey
The PropertyKey at the requested position.
Exceptions
- COMException
Thrown when the underlying Core Audio call fails.
GetValue(int)
Gets the managed property value at the specified zero-based index.
public PropertyValue GetValue(int index)
Parameters
Returns
- PropertyValue
The PropertyValue snapshot at the requested position.
Remarks
The returned snapshot holds no unmanaged resources and requires no cleanup.
Exceptions
- COMException
Thrown when the underlying Core Audio call fails.
TryGetValue(PropertyKey, out PropertyValue)
Reads the value of a single property by key, without scanning the store.
public bool TryGetValue(PropertyKey key, out PropertyValue value)
Parameters
keyPropertyKeyThe property key (set GUID and property id) to read.
valuePropertyValueThe managed snapshot, or an empty snapshot when the key is absent or the COM read fails.
Returns
- bool
trueif the read succeeds and the variant is neither empty nor null; otherwisefalse.
Remarks
The returned snapshot holds no unmanaged resources and requires no cleanup.