/********************************************************************++ Copyright (c) Microsoft Corporation. All rights reserved. --********************************************************************/ namespace System.Management.Automation.ComInterop { #region Generated Com Exception Factory // *** BEGIN GENERATED CODE *** // generated by function: gen_expr_factory_com from: generate_exception_factory.py /// /// Strongly-typed and parameterized string factory. /// internal static partial class Strings { private static string FormatString(string format, params object[] args) { return string.Format(System.Globalization.CultureInfo.CurrentCulture, format, args); } /// /// A string like "Unexpected VarEnum {0}." /// internal static string UnexpectedVarEnum(object p0) { return FormatString(ParserStrings.UnexpectedVarEnum, p0); } /// /// A string like "Error while invoking {0}." /// internal static string DispBadParamCount(object p0, int parameterCount) { return FormatString(ParserStrings.DispBadParamCount, p0, parameterCount); } /// /// A string like "Error while invoking {0}." /// internal static string DispMemberNotFound(object p0) { return FormatString(ParserStrings.DispMemberNotFound, p0); } /// /// A string like "Error while invoking {0}. Named arguments are not supported." /// internal static string DispNoNamedArgs(object p0) { return FormatString(ParserStrings.DispNoNamedArgs, p0); } /// /// A string like "Error while invoking {0}." /// internal static string DispOverflow(object p0) { return FormatString(ParserStrings.DispOverflow, p0); } /// /// A string like "Exception setting "{0}": "Cannot convert the "{1}" value of type "{2}" to type "{3}"." /// internal static string DispTypeMismatch(object method, string value, string originalTypeName, string destinationTypeName) { return FormatString(ParserStrings.DispTypeMismatch, method, value, originalTypeName, destinationTypeName); } /// /// A string like "Error while invoking {0}. A required parameter was omitted." /// internal static string DispParamNotOptional(object p0) { return FormatString(ParserStrings.DispParamNotOptional, p0); } /// /// A string like "IDispatch::GetIDsOfNames behaved unexpectedly for {0}." /// internal static string GetIDsOfNamesInvalid(object p0) { return FormatString(ParserStrings.GetIDsOfNamesInvalid, p0); } /// /// A string like "Could not get dispatch ID for {0} (error: {1})." /// internal static string CouldNotGetDispId(object p0, object p1) { return FormatString(ParserStrings.CouldNotGetDispId, p0, p1); } /// /// A string like "There are valid conversions from {0} to {1}." /// internal static string AmbiguousConversion(object p0, object p1) { return FormatString(ParserStrings.AmbiguousConversion, p0, p1); } /// /// A string like "Variant.GetAccessor cannot handle {0}." /// internal static string VariantGetAccessorNYI(object p0) { return FormatString(ParserStrings.VariantGetAccessorNYI, p0); } } /// /// Strongly-typed and parameterized exception factory. /// internal static partial class Error { /// /// ArgumentException with message like "COM object does not support events." /// internal static Exception COMObjectDoesNotSupportEvents() { return new ArgumentException(ParserStrings.COMObjectDoesNotSupportEvents); } /// /// ArgumentException with message like "COM object does not support specified source interface." /// internal static Exception COMObjectDoesNotSupportSourceInterface() { return new ArgumentException(ParserStrings.COMObjectDoesNotSupportSourceInterface); } /// /// InvalidOperationException with message like "Marshal.SetComObjectData failed." /// internal static Exception SetComObjectDataFailed() { return new InvalidOperationException(ParserStrings.SetComObjectDataFailed); } /// /// InvalidOperationException with message like "This method exists only to keep the compiler happy." /// internal static Exception MethodShouldNotBeCalled() { return new InvalidOperationException(ParserStrings.MethodShouldNotBeCalled); } /// /// InvalidOperationException with message like "Unexpected VarEnum {0}." /// internal static Exception UnexpectedVarEnum(object p0) { return new InvalidOperationException(Strings.UnexpectedVarEnum(p0)); } /// /// System.Reflection.TargetParameterCountException with message like "Error while invoking {0}." /// internal static Exception DispBadParamCount(object p0, int parameterCount) { return new System.Reflection.TargetParameterCountException(Strings.DispBadParamCount(p0, parameterCount)); } /// /// MissingMemberException with message like "Error while invoking {0}." /// internal static Exception DispMemberNotFound(object p0) { return new MissingMemberException(Strings.DispMemberNotFound(p0)); } /// /// ArgumentException with message like "Error while invoking {0}. Named arguments are not supported." /// internal static Exception DispNoNamedArgs(object p0) { return new ArgumentException(Strings.DispNoNamedArgs(p0)); } /// /// OverflowException with message like "Error while invoking {0}." /// internal static Exception DispOverflow(object p0) { return new OverflowException(Strings.DispOverflow(p0)); } /// /// ArgumentException with message like "Could not convert argument {0} for call to {1}." /// internal static Exception DispTypeMismatch(object method, string value, string originalTypeName, string destinationTypeName) { return new ArgumentException(Strings.DispTypeMismatch(method, value, originalTypeName, destinationTypeName)); } /// /// ArgumentException with message like "Error while invoking {0}. A required parameter was omitted." /// internal static Exception DispParamNotOptional(object p0) { return new ArgumentException(Strings.DispParamNotOptional(p0)); } /// /// InvalidOperationException with message like "ResolveComReference.CannotRetrieveTypeInformation." /// internal static Exception CannotRetrieveTypeInformation() { return new InvalidOperationException(ParserStrings.CannotRetrieveTypeInformation); } /// /// ArgumentException with message like "IDispatch::GetIDsOfNames behaved unexpectedly for {0}." /// internal static Exception GetIDsOfNamesInvalid(object p0) { return new ArgumentException(Strings.GetIDsOfNamesInvalid(p0)); } /// /// InvalidOperationException with message like "Attempting to wrap an unsupported enum type." /// internal static Exception UnsupportedEnumType() { return new InvalidOperationException(ParserStrings.UnsupportedEnumType); } /// /// InvalidOperationException with message like "Attempting to pass an event handler of an unsupported type." /// internal static Exception UnsupportedHandlerType() { return new InvalidOperationException(ParserStrings.UnsupportedHandlerType); } /// /// MissingMemberException with message like "Could not get dispatch ID for {0} (error: {1})." /// internal static Exception CouldNotGetDispId(object p0, object p1) { return new MissingMemberException(Strings.CouldNotGetDispId(p0, p1)); } /// /// System.Reflection.AmbiguousMatchException with message like "There are valid conversions from {0} to {1}." /// internal static Exception AmbiguousConversion(object p0, object p1) { return new System.Reflection.AmbiguousMatchException(Strings.AmbiguousConversion(p0, p1)); } /// /// NotImplementedException with message like "Variant.GetAccessor cannot handle {0}." /// internal static Exception VariantGetAccessorNYI(object p0) { return new NotImplementedException(Strings.VariantGetAccessorNYI(p0)); } } // *** END GENERATED CODE *** #endregion }