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
this[PropertyKey]
Indexer by guid
public PropertyStoreProperty this[PropertyKey key] { get; }
Parameters
keyPropertyKeyProperty Key
Property Value
- PropertyStoreProperty
Property or null if not found
this[int]
Gets property by index
public PropertyStoreProperty this[int index] { get; }
Parameters
indexintProperty 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
keyPropertyKeyLooks 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
indexintIndex
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
indexintIndex
Returns
- PropVariant
Property value
SetValue(PropertyKey, PropVariant)
Sets property value at specified key.
public void SetValue(PropertyKey key, PropVariant value)
Parameters
keyPropertyKeyKey of property to set.
valuePropVariantValue to write.
TryGetValue<T>(PropertyKey, out T)
Checks if the property exists
public bool TryGetValue<T>(PropertyKey key, out T obj)
Parameters
keyPropertyKeyLooks for a specific key
objTThe value of the property wrapped in a type cast
Returns
- bool
True if found
Type Parameters
TThe type to cast the property as