示例#1
0
        private int GetCount()
        {
            int count;

            Win32ComException.Try(GetCountNative(out count), InterfaceName, "GetCount");
            return(count);
        }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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);
        }
示例#4
0
 /// <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");
 }
示例#5
0
        /// <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");
        }