示例#1
0
        public PropVariant GetValue(int index)
        {
            PROPERTYKEY key = Get(index);

            Marshal.ThrowExceptionForHR(_Store.GetValue(ref key, out PropVariant result));
            return(result);
        }
示例#2
0
 public PropertyStoreProperty this[int index]
 {
     get
     {
         PROPERTYKEY key = Get(index);
         Marshal.ThrowExceptionForHR(_Store.GetValue(ref key, out PropVariant result));
         return(new PropertyStoreProperty(key, result));
     }
 }
 public bool Contains(PROPERTYKEY testKey)
 {
     for (int i = 0; i < Count; i++)
     {
         PROPERTYKEY key = Get(i);
         if (key.fmtid == testKey.fmtid && key.pid == testKey.pid)
             return true;
     }
     return false;
 }
示例#4
0
 public bool Contains(PROPERTYKEY testKey)
 {
     for (int i = 0; i < Count; i++)
     {
         PROPERTYKEY key = Get(i);
         if (key.fmtid == testKey.fmtid && key.pid == testKey.pid)
         {
             return(true);
         }
     }
     return(false);
 }
示例#5
0
 public PropertyStoreProperty this[PROPERTYKEY testKey]
 {
     get
     {
         for (int i = 0; i < Count; i++)
         {
             PROPERTYKEY key = Get(i);
             if (key.fmtid == testKey.fmtid && key.pid == testKey.pid)
             {
                 Marshal.ThrowExceptionForHR(_Store.GetValue(ref key, out PropVariant result));
                 return(new PropertyStoreProperty(key, result));
             }
         }
         return(null);
     }
 }
 public PropertyStoreProperty this[PROPERTYKEY testKey]
 {
     get
     {
         PropVariant result;
         for (int i = 0; i < Count; i++)
         {
             PROPERTYKEY key = Get(i);
             if (key.fmtid == testKey.fmtid && key.pid == testKey.pid)
             {
                 Marshal.ThrowExceptionForHR(_Store.GetValue(ref key, out result));
                 return new PropertyStoreProperty(key, result);
             }
         }
         return null;
     }
 }
示例#7
0
 public void OnPropertyValueChanged([In, MarshalAs(UnmanagedType.LPWStr)] string pwstrDeviceId, PROPERTYKEY key)
 {
     InvokeOnSynchronizationContext(() =>
     {
         var handler = DevicePropertyChanged;
         if (handler != null)
         {
             MMDevice device = GetDevice(pwstrDeviceId);
             if (device == null)
             {
                 return;     // Device was already removed by the time I got here
             }
             handler(this, new MMDeviceEventArgs(device));
         }
     });
 }
 internal PropertyStoreProperty(PROPERTYKEY key, PropVariant value)
 {
     _PropertyKey = key;
     _PropValue = value;
 }
 internal PropertyStoreProperty(PROPERTYKEY key, PropVariant value)
 {
     _PropertyKey = key;
     _PropValue   = value;
 }