mirror of https://github.com/dahall/Vanara.git
Added BindToHandler overloads accepting BHID enum values
parent
ab63ec5d26
commit
5f70c3f434
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue