Added BindToHandler overloads accepting BHID enum values

pull/187/head
dahall 2020-12-03 19:26:07 -07:00
parent ab63ec5d26
commit 5f70c3f434
1 changed files with 24 additions and 0 deletions

View File

@ -794,6 +794,18 @@ namespace Vanara.PInvoke
/// <returns>Receives the interface pointer requested in <typeparamref name="T"/>.</returns>
public static T BindToHandler<T>(this IShellItem si, [In] IBindCtx pbc, in Guid bhid) where T : class => (T)si.BindToHandler(pbc, bhid, typeof(T).GUID);
/// <summary>Extension method to simplify using the <see cref="IShellItem.BindToHandler"/> method.</summary>
/// <typeparam name="T">Type of the interface to get.</typeparam>
/// <param name="si">An <see cref="IShellItem"/> instance.</param>
/// <param name="pbc">
/// A pointer to an IBindCtx interface on a bind context object. Used to pass optional parameters to the handler. The contents of
/// the bind context are handler-specific. For example, when binding to BHID_Stream, the STGM flags in the bind context indicate
/// the mode of access desired (read or read/write).
/// </param>
/// <param name="bhid">A BHID enumeration value that specifies which handler will be created.</param>
/// <returns>Receives the interface pointer requested in <typeparamref name="T"/>.</returns>
public static T BindToHandler<T>(this IShellItem si, [In] IBindCtx pbc, BHID bhid) where T : class => (T)si.BindToHandler(pbc, bhid.Guid(), typeof(T).GUID);
/// <summary>Extension method to simplify using the <see cref="IShellItemArray.BindToHandler"/> method.</summary>
/// <typeparam name="T">Type of the interface to get.</typeparam>
/// <param name="sia">An <see cref="IShellItemArray"/> instance.</param>
@ -806,6 +818,18 @@ namespace Vanara.PInvoke
/// <returns>Receives the interface pointer requested in <typeparamref name="T"/>.</returns>
public static T BindToHandler<T>(this IShellItemArray sia, [In] IBindCtx pbc, in Guid rbhid) where T : class => (T)sia.BindToHandler(pbc, rbhid, typeof(T).GUID);
/// <summary>Extension method to simplify using the <see cref="IShellItemArray.BindToHandler"/> method.</summary>
/// <typeparam name="T">Type of the interface to get.</typeparam>
/// <param name="sia">An <see cref="IShellItemArray"/> instance.</param>
/// <param name="pbc">
/// A pointer to an IBindCtx interface on a bind context object. Used to pass optional parameters to the handler. The contents of
/// the bind context are handler-specific. For example, when binding to BHID_Stream, the STGM flags in the bind context indicate
/// the mode of access desired (read or read/write).
/// </param>
/// <param name="bhid">A BHID enumeration value that specifies which handler will be created.</param>
/// <returns>Receives the interface pointer requested in <typeparamref name="T"/>.</returns>
public static T BindToHandler<T>(this IShellItemArray sia, [In] IBindCtx pbc, BHID bhid) where T : class => (T)sia.BindToHandler(pbc, bhid.Guid(), typeof(T).GUID);
/// <summary>Extension method to simplify using the <see cref="IShellItemArray.GetPropertyStore"/> method.</summary>
/// <typeparam name="T">Type of the interface to get.</typeparam>
/// <param name="sia">An <see cref="IShellItemArray"/> instance.</param>