/// <summary>
 /// Contains property guid
 /// </summary>
 /// <param name="key">Looks for a specific key</param>
 /// <returns>True if found</returns>
 public bool Contains(PropertyKey key)
 {
     for (int i = 0; i < Count; i++)
     {
         PropertyKey ikey = Get(i);
         if ((ikey.formatId == key.formatId) && (ikey.propertyId == key.propertyId))
         {
             return true;
         }
     }
     return false;
 }
 internal PropertyStoreProperty(PropertyKey key, PropVariant value)
 {
     propertyKey = key;
     propertyValue = value;
 }
 /// <summary>
 /// Indexer by guid
 /// </summary>
 /// <param name="key">Property Key</param>
 /// <returns>Property or null if not found</returns>
 public PropertyStoreProperty this[PropertyKey key]
 {
     get
     {
         PropVariant result;
         for (int i = 0; i < Count; i++)
         {
             PropertyKey ikey = Get(i);
             if ((ikey.formatId == key.formatId) && (ikey.propertyId == key.propertyId))
             {
                 Marshal.ThrowExceptionForHR(storeInterface.GetValue(ref ikey, out result));
                 return new PropertyStoreProperty(ikey, result);
             }
         }
         return null;
     }
 }
Example #4
0
 public void OnPropertyValueChanged(string pwstrDeviceId, NAudio.CoreAudioApi.PropertyKey key)
 {
     Trace.WriteLine("OnPropertyValueChanged:" + pwstrDeviceId + " key:" + key);
 }
 /// <summary>
 /// Sets property value at specified key.
 /// </summary>
 /// <param name="key">Key of property to set.</param>
 /// <param name="value">Value to write.</param>
 public void SetValue(PropertyKey key, PropVariant value)
 {
     Marshal.ThrowExceptionForHR(storeInterface.SetValue(ref key, ref value));
 }
Example #6
0
 internal PropertyStoreProperty(PropertyKey key, PropVariant value)
 {
     this.propertyKey   = key;
     this.propertyValue = value;
 }
Example #7
0
 void IMMNotificationClient.OnPropertyValueChanged(string deviceId, PropertyKey propertyKey)
 {
     Debug.WriteLine("OnPropertyValueChanged:  formatId --> {0}  propertyId--> {1}", propertyKey.formatId.ToString(), propertyKey.propertyId.ToString());
 }