Added explicit operator to uint

pull/83/head
David Hall 2019-09-02 17:09:39 -06:00
parent be728e1b29
commit 4cae44c14e
1 changed files with 6 additions and 1 deletions

View File

@ -427,7 +427,12 @@ namespace Vanara.PInvoke
/// <summary>Performs an explicit conversion from <see cref="HRESULT"/> to <see cref="System.Int32"/>.</summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
public static explicit operator int(HRESULT value) => (int)value._value;
public static explicit operator int(HRESULT value) => unchecked((int)value._value);
/// <summary>Performs an explicit conversion from <see cref="HRESULT"/> to <see cref="System.UInt32"/>.</summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
public static explicit operator uint(HRESULT value) => value._value;
/// <summary>Performs an explicit conversion from <see cref="System.Boolean"/> to <see cref="HRESULT"/>.</summary>
/// <param name="value">if set to <see langword="true" /> returns S_OK; otherwise S_FALSE.</param>