mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
91 lines
2.7 KiB
C#
91 lines
2.7 KiB
C#
//------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//------------------------------------------------------------
|
|
|
|
namespace System.ServiceModel.Administration
|
|
{
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
|
|
internal class WbemException : Win32Exception
|
|
{
|
|
internal WbemException(WbemNative.WbemStatus hr)
|
|
: base((int)hr)
|
|
{
|
|
}
|
|
|
|
internal WbemException(int hr)
|
|
: base(hr)
|
|
{
|
|
}
|
|
|
|
internal WbemException(int hr, string message)
|
|
: base(hr, message)
|
|
{
|
|
}
|
|
|
|
internal static void Throw(WbemNative.WbemStatus hr)
|
|
{
|
|
switch (hr)
|
|
{
|
|
case WbemNative.WbemStatus.WBEM_E_NOT_FOUND:
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemInstanceNotFoundException());
|
|
case WbemNative.WbemStatus.WBEM_E_INVALID_PARAMETER:
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemInvalidParameterException());
|
|
case WbemNative.WbemStatus.WBEM_E_NOT_SUPPORTED:
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemNotSupportedException());
|
|
case WbemNative.WbemStatus.WBEM_E_INVALID_METHOD:
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemInvalidMethodException());
|
|
default:
|
|
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemException(hr));
|
|
}
|
|
}
|
|
|
|
internal static void ThrowIfFail(int hr)
|
|
{
|
|
if (hr < 0)
|
|
{
|
|
Throw((WbemNative.WbemStatus)hr);
|
|
}
|
|
}
|
|
}
|
|
|
|
internal class WbemInstanceNotFoundException : WbemException
|
|
{
|
|
internal WbemInstanceNotFoundException()
|
|
: base(WbemNative.WbemStatus.WBEM_E_NOT_FOUND)
|
|
{
|
|
}
|
|
}
|
|
|
|
internal class WbemInvalidParameterException : WbemException
|
|
{
|
|
internal WbemInvalidParameterException(string name)
|
|
: base((int)WbemNative.WbemStatus.WBEM_E_INVALID_PARAMETER, name)
|
|
{
|
|
}
|
|
|
|
internal WbemInvalidParameterException()
|
|
: base(WbemNative.WbemStatus.WBEM_E_INVALID_PARAMETER)
|
|
{
|
|
}
|
|
}
|
|
|
|
internal class WbemNotSupportedException : WbemException
|
|
{
|
|
internal WbemNotSupportedException()
|
|
: base(WbemNative.WbemStatus.WBEM_E_NOT_SUPPORTED)
|
|
{
|
|
}
|
|
}
|
|
|
|
internal class WbemInvalidMethodException : WbemException
|
|
{
|
|
internal WbemInvalidMethodException()
|
|
: base(WbemNative.WbemStatus.WBEM_E_INVALID_METHOD)
|
|
{
|
|
}
|
|
}
|
|
}
|