1 /* ****************************************************************************
3 * Copyright (c) Microsoft Corporation.
5 * This source code is subject to terms and conditions of the Microsoft Public License. A
6 * copy of the license can be found in the License.html file at the root of this distribution. If
7 * you cannot locate the Microsoft Public License, please send an email to
8 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
9 * by the terms of the Microsoft Public License.
11 * You must not remove this notice, or any other, from this software.
14 * ***************************************************************************/
15 using System; using Microsoft;
20 namespace System.Dynamic {
22 namespace Microsoft.Scripting {
26 internal static partial class Strings {
27 private static string FormatString(string format, params object[] args) {
28 return string.Format(System.Globalization.CultureInfo.CurrentCulture, format, args);
32 #region Generated Com Exception Factory
34 // *** BEGIN GENERATED CODE ***
35 // generated by function: gen_expr_factory_com from: generate_exception_factory.py
38 /// Strongly-typed and parameterized string factory.
41 internal static partial class Strings {
43 /// A string like "Invalid argument value"
45 internal static string InvalidArgumentValue {
47 return "Invalid argument value";
52 /// A string like "COM object is expected."
54 internal static string ComObjectExpected {
56 return "COM object is expected.";
61 /// A string like "Cannot perform call."
63 internal static string CannotCall {
65 return "Cannot perform call.";
70 /// A string like "COM object does not support events."
72 internal static string COMObjectDoesNotSupportEvents {
74 return "COM object does not support events.";
79 /// A string like "COM object does not support specified source interface."
81 internal static string COMObjectDoesNotSupportSourceInterface {
83 return "COM object does not support specified source interface.";
88 /// A string like "Marshal.SetComObjectData failed."
90 internal static string SetComObjectDataFailed {
92 return "Marshal.SetComObjectData failed.";
97 /// A string like "This method exists only to keep the compiler happy."
99 internal static string MethodShouldNotBeCalled {
101 return "This method exists only to keep the compiler happy.";
106 /// A string like "Unexpected VarEnum {0}."
108 internal static string UnexpectedVarEnum(object p0) {
109 return FormatString("Unexpected VarEnum {0}.", p0);
113 /// A string like "Error while invoking {0}."
115 internal static string DispBadParamCount(object p0) {
116 return FormatString("Error while invoking {0}.", p0);
120 /// A string like "Error while invoking {0}."
122 internal static string DispMemberNotFound(object p0) {
123 return FormatString("Error while invoking {0}.", p0);
127 /// A string like "Error while invoking {0}. Named arguments are not supported."
129 internal static string DispNoNamedArgs(object p0) {
130 return FormatString("Error while invoking {0}. Named arguments are not supported.", p0);
134 /// A string like "Error while invoking {0}."
136 internal static string DispOverflow(object p0) {
137 return FormatString("Error while invoking {0}.", p0);
141 /// A string like "Could not convert argument {0} for call to {1}."
143 internal static string DispTypeMismatch(object p0, object p1) {
144 return FormatString("Could not convert argument {0} for call to {1}.", p0, p1);
148 /// A string like "Error while invoking {0}. A required parameter was omitted."
150 internal static string DispParamNotOptional(object p0) {
151 return FormatString("Error while invoking {0}. A required parameter was omitted.", p0);
155 /// A string like "ResolveComReference.CannotRetrieveTypeInformation."
157 internal static string CannotRetrieveTypeInformation {
159 return "ResolveComReference.CannotRetrieveTypeInformation.";
164 /// A string like "IDispatch::GetIDsOfNames behaved unexpectedly for {0}."
166 internal static string GetIDsOfNamesInvalid(object p0) {
167 return FormatString("IDispatch::GetIDsOfNames behaved unexpectedly for {0}.", p0);
171 /// A string like "Attempting to wrap an unsupported enum type."
173 internal static string UnsupportedEnumType {
175 return "Attempting to wrap an unsupported enum type.";
180 /// A string like "Attempting to pass an event handler of an unsupported type."
182 internal static string UnsupportedHandlerType {
184 return "Attempting to pass an event handler of an unsupported type.";
189 /// A string like "Could not get dispatch ID for {0} (error: {1})."
191 internal static string CouldNotGetDispId(object p0, object p1) {
192 return FormatString("Could not get dispatch ID for {0} (error: {1}).", p0, p1);
196 /// A string like "There are valid conversions from {0} to {1}."
198 internal static string AmbiguousConversion(object p0, object p1) {
199 return FormatString("There are valid conversions from {0} to {1}.", p0, p1);
203 /// A string like "Variant.GetAccessor cannot handle {0}."
205 internal static string VariantGetAccessorNYI(object p0) {
206 return FormatString("Variant.GetAccessor cannot handle {0}.", p0);
211 /// Strongly-typed and parameterized exception factory.
214 internal static partial class Error {
216 /// ArgumentException with message like "COM object does not support events."
218 internal static Exception COMObjectDoesNotSupportEvents() {
219 return new ArgumentException(Strings.COMObjectDoesNotSupportEvents);
223 /// ArgumentException with message like "COM object does not support specified source interface."
225 internal static Exception COMObjectDoesNotSupportSourceInterface() {
226 return new ArgumentException(Strings.COMObjectDoesNotSupportSourceInterface);
230 /// InvalidOperationException with message like "Marshal.SetComObjectData failed."
232 internal static Exception SetComObjectDataFailed() {
233 return new InvalidOperationException(Strings.SetComObjectDataFailed);
237 /// InvalidOperationException with message like "This method exists only to keep the compiler happy."
239 internal static Exception MethodShouldNotBeCalled() {
240 return new InvalidOperationException(Strings.MethodShouldNotBeCalled);
244 /// InvalidOperationException with message like "Unexpected VarEnum {0}."
246 internal static Exception UnexpectedVarEnum(object p0) {
247 return new InvalidOperationException(Strings.UnexpectedVarEnum(p0));
251 /// System.Reflection.TargetParameterCountException with message like "Error while invoking {0}."
253 internal static Exception DispBadParamCount(object p0) {
254 return new System.Reflection.TargetParameterCountException(Strings.DispBadParamCount(p0));
258 /// MissingMemberException with message like "Error while invoking {0}."
260 internal static Exception DispMemberNotFound(object p0) {
261 return new MissingMemberException(Strings.DispMemberNotFound(p0));
265 /// ArgumentException with message like "Error while invoking {0}. Named arguments are not supported."
267 internal static Exception DispNoNamedArgs(object p0) {
268 return new ArgumentException(Strings.DispNoNamedArgs(p0));
272 /// OverflowException with message like "Error while invoking {0}."
274 internal static Exception DispOverflow(object p0) {
275 return new OverflowException(Strings.DispOverflow(p0));
279 /// ArgumentException with message like "Could not convert argument {0} for call to {1}."
281 internal static Exception DispTypeMismatch(object p0, object p1) {
282 return new ArgumentException(Strings.DispTypeMismatch(p0, p1));
286 /// ArgumentException with message like "Error while invoking {0}. A required parameter was omitted."
288 internal static Exception DispParamNotOptional(object p0) {
289 return new ArgumentException(Strings.DispParamNotOptional(p0));
293 /// InvalidOperationException with message like "ResolveComReference.CannotRetrieveTypeInformation."
295 internal static Exception CannotRetrieveTypeInformation() {
296 return new InvalidOperationException(Strings.CannotRetrieveTypeInformation);
300 /// ArgumentException with message like "IDispatch::GetIDsOfNames behaved unexpectedly for {0}."
302 internal static Exception GetIDsOfNamesInvalid(object p0) {
303 return new ArgumentException(Strings.GetIDsOfNamesInvalid(p0));
307 /// InvalidOperationException with message like "Attempting to wrap an unsupported enum type."
309 internal static Exception UnsupportedEnumType() {
310 return new InvalidOperationException(Strings.UnsupportedEnumType);
314 /// InvalidOperationException with message like "Attempting to pass an event handler of an unsupported type."
316 internal static Exception UnsupportedHandlerType() {
317 return new InvalidOperationException(Strings.UnsupportedHandlerType);
321 /// MissingMemberException with message like "Could not get dispatch ID for {0} (error: {1})."
323 internal static Exception CouldNotGetDispId(object p0, object p1) {
324 return new MissingMemberException(Strings.CouldNotGetDispId(p0, p1));
328 /// System.Reflection.AmbiguousMatchException with message like "There are valid conversions from {0} to {1}."
330 internal static Exception AmbiguousConversion(object p0, object p1) {
331 return new System.Reflection.AmbiguousMatchException(Strings.AmbiguousConversion(p0, p1));
335 /// NotImplementedException with message like "Variant.GetAccessor cannot handle {0}."
337 internal static Exception VariantGetAccessorNYI(object p0) {
338 return new NotImplementedException(Strings.VariantGetAccessorNYI(p0));
343 // *** END GENERATED CODE ***