示例#1
0
        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());
            }
            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new WbemException(hr));
        }
示例#2
0
 internal WbemException(WbemNative.WbemStatus hr) : base((int)hr)
 {
 }