Exemple #1
0
        // ReSharper disable once InconsistentNaming
        /// <summary>Gets the CLSID of a supplied property key.</summary>
        /// <param name="key">The property key.</param>
        /// <returns>The CLSID related to the property key.</returns>
        public Guid GetCLSID(Guid key)
        {
            ThrowIfNoShellItem2();
            var shipk = new ShellItemPropertyKey(key, 2);

            return(iShellItem2.GetCLSID(ref shipk));
        }
Exemple #2
0
 /// <summary>Gets the property specified by <paramref name="key"/>.</summary>
 /// <typeparam name="T">Property type</typeparam>
 /// <param name="key">The property key.</param>
 /// <param name="defValue">The default value.</param>
 /// <returns>The value of the property or <paramref name="defValue"/> if not found.</returns>
 public T GetProperty <T>(ShellItemPropertyKey key, T defValue = default(T))
 {
     try
     {
         return((T)Properties[key]);
     }
     catch { }
     return(defValue);
 }