using System;
namespace System.Runtime.InteropServices
{
/// Wraps objects the marshaler should marshal as a VT_ERROR.
// Token: 0x0200030E RID: 782
[ComVisible(true)]
[Serializable]
public sealed class ErrorWrapper
{
/// Initializes a new instance of the class with the HRESULT that corresponds to the exception supplied.
/// The exception to be converted to an error code.
// Token: 0x060021F1 RID: 8689 RVA: 0x000793DC File Offset: 0x000775DC
public ErrorWrapper(Exception e)
{
this.errorCode = Marshal.GetHRForException(e);
}
/// Initializes a new instance of the class with the HRESULT of the error.
/// The HRESULT of the error.
// Token: 0x060021F2 RID: 8690 RVA: 0x000793F0 File Offset: 0x000775F0
public ErrorWrapper(int errorCode)
{
this.errorCode = errorCode;
}
/// Initializes a new instance of the class with an object containing the HRESULT of the error.
/// The object containing the HRESULT of the error.
/// The parameter is not an type.
// 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;
}
/// Gets the error code of the wrapper.
/// The HRESULT of the error.
// 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;
}
}