Files
2026-06-04 11:42:34 +02:00

56 lines
2.1 KiB
C#

using System;
namespace System.Runtime.InteropServices
{
/// <summary>Wraps objects the marshaler should marshal as a VT_ERROR.</summary>
// Token: 0x0200030E RID: 782
[ComVisible(true)]
[Serializable]
public sealed class ErrorWrapper
{
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.ErrorWrapper" /> class with the HRESULT that corresponds to the exception supplied.</summary>
/// <param name="e">The exception to be converted to an error code. </param>
// Token: 0x060021F1 RID: 8689 RVA: 0x000793DC File Offset: 0x000775DC
public ErrorWrapper(Exception e)
{
this.errorCode = Marshal.GetHRForException(e);
}
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.ErrorWrapper" /> class with the HRESULT of the error.</summary>
/// <param name="errorCode">The HRESULT of the error. </param>
// Token: 0x060021F2 RID: 8690 RVA: 0x000793F0 File Offset: 0x000775F0
public ErrorWrapper(int errorCode)
{
this.errorCode = errorCode;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.ErrorWrapper" /> class with an object containing the HRESULT of the error.</summary>
/// <param name="errorCode">The object containing the HRESULT of the error. </param>
/// <exception cref="T:System.ArgumentException">The <paramref name="errorCode" /> parameter is not an <see cref="T:System.Int32" /> type.</exception>
// Token: 0x060021F3 RID: 8691 RVA: 0x00079400 File Offset: 0x00077600
public ErrorWrapper(object errorCode)
{
if (errorCode.GetType() != typeof(int))
{
throw new ArgumentException("errorCode has to be an int type");
}
this.errorCode = (int)errorCode;
}
/// <summary>Gets the error code of the wrapper.</summary>
/// <returns>The HRESULT of the error.</returns>
// Token: 0x1700064B RID: 1611
// (get) Token: 0x060021F4 RID: 8692 RVA: 0x00079440 File Offset: 0x00077640
public int ErrorCode
{
get
{
return this.errorCode;
}
}
// Token: 0x04000D13 RID: 3347
private int errorCode;
}
}