2009-07-11 Michael Barker <mike@middlesoft.co.uk>
[mono.git] / mcs / class / dlr / Runtime / Microsoft.Dynamic / Errors.cs
1 /* ****************************************************************************
2  *
3  * Copyright (c) Microsoft Corporation. 
4  *
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.
10  *
11  * You must not remove this notice, or any other, from this software.
12  *
13  *
14  * ***************************************************************************/
15 using System; using Microsoft;
16
17
18
19 #if CODEPLEX_40
20 namespace System.Dynamic {
21 #else
22 namespace Microsoft.Scripting {
23 #endif
24
25 #if MICROSOFT_DYNAMIC
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);
29         }
30     }
31    
32     #region Generated Com Exception Factory
33
34     // *** BEGIN GENERATED CODE ***
35     // generated by function: gen_expr_factory_com from: generate_exception_factory.py
36
37     /// <summary>
38     ///    Strongly-typed and parameterized string factory.
39     /// </summary>
40
41     internal static partial class Strings {
42         /// <summary>
43         /// A string like  "Invalid argument value"
44         /// </summary>
45         internal static string InvalidArgumentValue {
46             get {
47                 return "Invalid argument value";
48             }
49         }
50
51         /// <summary>
52         /// A string like  "COM object is expected."
53         /// </summary>
54         internal static string ComObjectExpected {
55             get {
56                 return "COM object is expected.";
57             }
58         }
59
60         /// <summary>
61         /// A string like  "Cannot perform call."
62         /// </summary>
63         internal static string CannotCall {
64             get {
65                 return "Cannot perform call.";
66             }
67         }
68
69         /// <summary>
70         /// A string like  "COM object does not support events."
71         /// </summary>
72         internal static string COMObjectDoesNotSupportEvents {
73             get {
74                 return "COM object does not support events.";
75             }
76         }
77
78         /// <summary>
79         /// A string like  "COM object does not support specified source interface."
80         /// </summary>
81         internal static string COMObjectDoesNotSupportSourceInterface {
82             get {
83                 return "COM object does not support specified source interface.";
84             }
85         }
86
87         /// <summary>
88         /// A string like  "Marshal.SetComObjectData failed."
89         /// </summary>
90         internal static string SetComObjectDataFailed {
91             get {
92                 return "Marshal.SetComObjectData failed.";
93             }
94         }
95
96         /// <summary>
97         /// A string like  "This method exists only to keep the compiler happy."
98         /// </summary>
99         internal static string MethodShouldNotBeCalled {
100             get {
101                 return "This method exists only to keep the compiler happy.";
102             }
103         }
104
105         /// <summary>
106         /// A string like  "Unexpected VarEnum {0}."
107         /// </summary>
108         internal static string UnexpectedVarEnum(object p0) {
109             return FormatString("Unexpected VarEnum {0}.", p0);
110         }
111
112         /// <summary>
113         /// A string like  "Error while invoking {0}."
114         /// </summary>
115         internal static string DispBadParamCount(object p0) {
116             return FormatString("Error while invoking {0}.", p0);
117         }
118
119         /// <summary>
120         /// A string like  "Error while invoking {0}."
121         /// </summary>
122         internal static string DispMemberNotFound(object p0) {
123             return FormatString("Error while invoking {0}.", p0);
124         }
125
126         /// <summary>
127         /// A string like  "Error while invoking {0}. Named arguments are not supported."
128         /// </summary>
129         internal static string DispNoNamedArgs(object p0) {
130             return FormatString("Error while invoking {0}. Named arguments are not supported.", p0);
131         }
132
133         /// <summary>
134         /// A string like  "Error while invoking {0}."
135         /// </summary>
136         internal static string DispOverflow(object p0) {
137             return FormatString("Error while invoking {0}.", p0);
138         }
139
140         /// <summary>
141         /// A string like  "Could not convert argument {0} for call to {1}."
142         /// </summary>
143         internal static string DispTypeMismatch(object p0, object p1) {
144             return FormatString("Could not convert argument {0} for call to {1}.", p0, p1);
145         }
146
147         /// <summary>
148         /// A string like  "Error while invoking {0}. A required parameter was omitted."
149         /// </summary>
150         internal static string DispParamNotOptional(object p0) {
151             return FormatString("Error while invoking {0}. A required parameter was omitted.", p0);
152         }
153
154         /// <summary>
155         /// A string like  "ResolveComReference.CannotRetrieveTypeInformation."
156         /// </summary>
157         internal static string CannotRetrieveTypeInformation {
158             get {
159                 return "ResolveComReference.CannotRetrieveTypeInformation.";
160             }
161         }
162
163         /// <summary>
164         /// A string like  "IDispatch::GetIDsOfNames behaved unexpectedly for {0}."
165         /// </summary>
166         internal static string GetIDsOfNamesInvalid(object p0) {
167             return FormatString("IDispatch::GetIDsOfNames behaved unexpectedly for {0}.", p0);
168         }
169
170         /// <summary>
171         /// A string like  "Attempting to wrap an unsupported enum type."
172         /// </summary>
173         internal static string UnsupportedEnumType {
174             get {
175                 return "Attempting to wrap an unsupported enum type.";
176             }
177         }
178
179         /// <summary>
180         /// A string like  "Attempting to pass an event handler of an unsupported type."
181         /// </summary>
182         internal static string UnsupportedHandlerType {
183             get {
184                 return "Attempting to pass an event handler of an unsupported type.";
185             }
186         }
187
188         /// <summary>
189         /// A string like  "Could not get dispatch ID for {0} (error: {1})."
190         /// </summary>
191         internal static string CouldNotGetDispId(object p0, object p1) {
192             return FormatString("Could not get dispatch ID for {0} (error: {1}).", p0, p1);
193         }
194
195         /// <summary>
196         /// A string like  "There are valid conversions from {0} to {1}."
197         /// </summary>
198         internal static string AmbiguousConversion(object p0, object p1) {
199             return FormatString("There are valid conversions from {0} to {1}.", p0, p1);
200         }
201
202         /// <summary>
203         /// A string like  "Variant.GetAccessor cannot handle {0}."
204         /// </summary>
205         internal static string VariantGetAccessorNYI(object p0) {
206             return FormatString("Variant.GetAccessor cannot handle {0}.", p0);
207         }
208
209     }
210     /// <summary>
211     ///    Strongly-typed and parameterized exception factory.
212     /// </summary>
213
214     internal static partial class Error {
215         /// <summary>
216         /// ArgumentException with message like "COM object does not support events."
217         /// </summary>
218         internal static Exception COMObjectDoesNotSupportEvents() {
219             return new ArgumentException(Strings.COMObjectDoesNotSupportEvents);
220         }
221
222         /// <summary>
223         /// ArgumentException with message like "COM object does not support specified source interface."
224         /// </summary>
225         internal static Exception COMObjectDoesNotSupportSourceInterface() {
226             return new ArgumentException(Strings.COMObjectDoesNotSupportSourceInterface);
227         }
228
229         /// <summary>
230         /// InvalidOperationException with message like "Marshal.SetComObjectData failed."
231         /// </summary>
232         internal static Exception SetComObjectDataFailed() {
233             return new InvalidOperationException(Strings.SetComObjectDataFailed);
234         }
235
236         /// <summary>
237         /// InvalidOperationException with message like "This method exists only to keep the compiler happy."
238         /// </summary>
239         internal static Exception MethodShouldNotBeCalled() {
240             return new InvalidOperationException(Strings.MethodShouldNotBeCalled);
241         }
242
243         /// <summary>
244         /// InvalidOperationException with message like "Unexpected VarEnum {0}."
245         /// </summary>
246         internal static Exception UnexpectedVarEnum(object p0) {
247             return new InvalidOperationException(Strings.UnexpectedVarEnum(p0));
248         }
249
250         /// <summary>
251         /// System.Reflection.TargetParameterCountException with message like "Error while invoking {0}."
252         /// </summary>
253         internal static Exception DispBadParamCount(object p0) {
254             return new System.Reflection.TargetParameterCountException(Strings.DispBadParamCount(p0));
255         }
256
257         /// <summary>
258         /// MissingMemberException with message like "Error while invoking {0}."
259         /// </summary>
260         internal static Exception DispMemberNotFound(object p0) {
261             return new MissingMemberException(Strings.DispMemberNotFound(p0));
262         }
263
264         /// <summary>
265         /// ArgumentException with message like "Error while invoking {0}. Named arguments are not supported."
266         /// </summary>
267         internal static Exception DispNoNamedArgs(object p0) {
268             return new ArgumentException(Strings.DispNoNamedArgs(p0));
269         }
270
271         /// <summary>
272         /// OverflowException with message like "Error while invoking {0}."
273         /// </summary>
274         internal static Exception DispOverflow(object p0) {
275             return new OverflowException(Strings.DispOverflow(p0));
276         }
277
278         /// <summary>
279         /// ArgumentException with message like "Could not convert argument {0} for call to {1}."
280         /// </summary>
281         internal static Exception DispTypeMismatch(object p0, object p1) {
282             return new ArgumentException(Strings.DispTypeMismatch(p0, p1));
283         }
284
285         /// <summary>
286         /// ArgumentException with message like "Error while invoking {0}. A required parameter was omitted."
287         /// </summary>
288         internal static Exception DispParamNotOptional(object p0) {
289             return new ArgumentException(Strings.DispParamNotOptional(p0));
290         }
291
292         /// <summary>
293         /// InvalidOperationException with message like "ResolveComReference.CannotRetrieveTypeInformation."
294         /// </summary>
295         internal static Exception CannotRetrieveTypeInformation() {
296             return new InvalidOperationException(Strings.CannotRetrieveTypeInformation);
297         }
298
299         /// <summary>
300         /// ArgumentException with message like "IDispatch::GetIDsOfNames behaved unexpectedly for {0}."
301         /// </summary>
302         internal static Exception GetIDsOfNamesInvalid(object p0) {
303             return new ArgumentException(Strings.GetIDsOfNamesInvalid(p0));
304         }
305
306         /// <summary>
307         /// InvalidOperationException with message like "Attempting to wrap an unsupported enum type."
308         /// </summary>
309         internal static Exception UnsupportedEnumType() {
310             return new InvalidOperationException(Strings.UnsupportedEnumType);
311         }
312
313         /// <summary>
314         /// InvalidOperationException with message like "Attempting to pass an event handler of an unsupported type."
315         /// </summary>
316         internal static Exception UnsupportedHandlerType() {
317             return new InvalidOperationException(Strings.UnsupportedHandlerType);
318         }
319
320         /// <summary>
321         /// MissingMemberException with message like "Could not get dispatch ID for {0} (error: {1})."
322         /// </summary>
323         internal static Exception CouldNotGetDispId(object p0, object p1) {
324             return new MissingMemberException(Strings.CouldNotGetDispId(p0, p1));
325         }
326
327         /// <summary>
328         /// System.Reflection.AmbiguousMatchException with message like "There are valid conversions from {0} to {1}."
329         /// </summary>
330         internal static Exception AmbiguousConversion(object p0, object p1) {
331             return new System.Reflection.AmbiguousMatchException(Strings.AmbiguousConversion(p0, p1));
332         }
333
334         /// <summary>
335         /// NotImplementedException with message like "Variant.GetAccessor cannot handle {0}."
336         /// </summary>
337         internal static Exception VariantGetAccessorNYI(object p0) {
338             return new NotImplementedException(Strings.VariantGetAccessorNYI(p0));
339         }
340
341     }
342
343     // *** END GENERATED CODE ***
344
345     #endregion
346
347 #endif
348 }