private int GetCount() { int count; Win32ComException.Try(GetCountNative(out count), InterfaceName, "GetCount"); return(count); }
/// <summary> /// Gets data for a specific property. /// </summary> /// <param name="key">The <see cref="PropertyKey"/> of the property. The key can be obtained by calling the <see cref="GetKey"/> method.</param> /// <returns>The data of the specified property.</returns> public PropertyVariant GetValue(PropertyKey key) { PropertyVariant value; int result = GetValueNative(key, out value); Win32ComException.Try(result, InterfaceName, "GetValue"); return(value); }
/// <summary> /// Gets a property key from an item's array of properties. /// </summary> /// <param name="index">The zero-based index of the property key in the array of <see cref="PropertyKey"/> structures.</param> /// <returns>The <see cref="PropertyKey"/>.</returns> public PropertyKey GetKey(int index) { if (index >= Count) { throw new ArgumentOutOfRangeException("index"); } PropertyKey key; int result = GetAtNative(index, out key); Win32ComException.Try(result, InterfaceName, "GetAt"); return(key); }
/// <summary> /// Saves a property change. /// </summary> /// <remarks> /// For more information see /// <see href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb761470%28v=vs.85%29.aspx" />. /// </remarks> public void Commit() { Win32ComException.Try(CommitNative(), InterfaceName, "Commit"); }
/// <summary> /// Sets a new property value, or replaces or removes an existing value. /// </summary> /// <param name="key">The <see cref="PropertyKey"/> of the property. The key can be obtained by calling the <see cref="GetKey"/> method.</param> /// <param name="value">The new property data.</param> public void SetValue(PropertyKey key, PropertyVariant value) { int result = SetValueNative(key, value); Win32ComException.Try(result, InterfaceName, "SetValue"); }