/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System; namespace Microsoft.Scripting { internal static partial class Strings { private static string FormatString(string format, params object[] args) { return string.Format(System.Globalization.CultureInfo.CurrentCulture, format, args); } } #region Generated Microsoft.Scripting Exception Factory // *** BEGIN GENERATED CODE *** // generated by function: gen_expr_factory_scripting from: generate_exception_factory.py /// /// Strongly-typed and parameterized string factory. /// internal static partial class Strings { /// /// A string like "Cannot access member {1} declared on type {0} because the type contains generic parameters." /// internal static string InvalidOperation_ContainsGenericParameters(object p0, object p1) { return FormatString("Cannot access member {1} declared on type {0} because the type contains generic parameters.", p0, p1); } /// /// A string like "Type '{0}' is missing or cannot be loaded." /// internal static string MissingType(object p0) { return FormatString("Type '{0}' is missing or cannot be loaded.", p0); } /// /// A string like "static property "{0}" of "{1}" can only be read through a type, not an instance" /// internal static string StaticAccessFromInstanceError(object p0, object p1) { return FormatString("static property \"{0}\" of \"{1}\" can only be read through a type, not an instance", p0, p1); } /// /// A string like "static property "{0}" of "{1}" can only be assigned to through a type, not an instance" /// internal static string StaticAssignmentFromInstanceError(object p0, object p1) { return FormatString("static property \"{0}\" of \"{1}\" can only be assigned to through a type, not an instance", p0, p1); } /// /// A string like "Method precondition violated" /// internal static string MethodPreconditionViolated { get { return "Method precondition violated"; } } /// /// A string like "Invalid argument value" /// internal static string InvalidArgumentValue { get { return "Invalid argument value"; } } /// /// A string like "Non-empty string required" /// internal static string NonEmptyStringRequired { get { return "Non-empty string required"; } } /// /// A string like "Non-empty collection required" /// internal static string NonEmptyCollectionRequired { get { return "Non-empty collection required"; } } /// /// A string like "must by an Exception instance" /// internal static string MustBeExceptionInstance { get { return "must by an Exception instance"; } } /// /// A string like "Type of test must be bool" /// internal static string TypeOfTestMustBeBool { get { return "Type of test must be bool"; } } /// /// A string like "Type of the expression must be bool" /// internal static string TypeOfExpressionMustBeBool { get { return "Type of the expression must be bool"; } } /// /// A string like "Empty string is not a valid path." /// internal static string EmptyStringIsInvalidPath { get { return "Empty string is not a valid path."; } } /// /// A string like "Invalid delegate type (Invoke method not found)." /// internal static string InvalidDelegate { get { return "Invalid delegate type (Invoke method not found)."; } } /// /// A string like "expected only static property" /// internal static string ExpectedStaticProperty { get { return "expected only static property"; } } /// /// A string like "Property doesn't exist on the provided type" /// internal static string PropertyDoesNotExist { get { return "Property doesn't exist on the provided type"; } } /// /// A string like "Field doesn't exist on provided type" /// internal static string FieldDoesNotExist { get { return "Field doesn't exist on provided type"; } } /// /// A string like "Type doesn't have constructor with a given signature" /// internal static string TypeDoesNotHaveConstructorForTheSignature { get { return "Type doesn't have constructor with a given signature"; } } /// /// A string like "Type doesn't have a method with a given name." /// internal static string TypeDoesNotHaveMethodForName { get { return "Type doesn't have a method with a given name."; } } /// /// A string like "Type doesn't have a method with a given name and signature." /// internal static string TypeDoesNotHaveMethodForNameSignature { get { return "Type doesn't have a method with a given name and signature."; } } /// /// A string like "Count must be non-negative." /// internal static string CountCannotBeNegative { get { return "Count must be non-negative."; } } /// /// A string like "arrayType must be an array type" /// internal static string ArrayTypeMustBeArray { get { return "arrayType must be an array type"; } } /// /// A string like "Either code or target must be specified." /// internal static string MustHaveCodeOrTarget { get { return "Either code or target must be specified."; } } /// /// A string like "Type parameter is {0}. Expected a delegate." /// internal static string TypeParameterIsNotDelegate(object p0) { return FormatString("Type parameter is {0}. Expected a delegate.", p0); } /// /// A string like "Cannot cast from type '{0}' to type '{1}" /// internal static string InvalidCast(object p0, object p1) { return FormatString("Cannot cast from type '{0}' to type '{1}", p0, p1); } /// /// A string like "unknown member type: '{0}'. " /// internal static string UnknownMemberType(object p0) { return FormatString("unknown member type: '{0}'. ", p0); } /// /// A string like "RuleBuilder can only be used with delegates whose first argument is CallSite." /// internal static string FirstArgumentMustBeCallSite { get { return "RuleBuilder can only be used with delegates whose first argument is CallSite."; } } /// /// A string like "no instance for call." /// internal static string NoInstanceForCall { get { return "no instance for call."; } } /// /// A string like "Missing Test." /// internal static string MissingTest { get { return "Missing Test."; } } /// /// A string like "Missing Target." /// internal static string MissingTarget { get { return "Missing Target."; } } /// /// A string like "The operation requires a non-generic type for {0}, but this represents generic types only" /// internal static string NonGenericWithGenericGroup(object p0) { return FormatString("The operation requires a non-generic type for {0}, but this represents generic types only", p0); } /// /// A string like "Invalid operation: '{0}'" /// internal static string InvalidOperation(object p0) { return FormatString("Invalid operation: '{0}'", p0); } /// /// A string like "Finally already defined." /// internal static string FinallyAlreadyDefined { get { return "Finally already defined."; } } /// /// A string like "Can not have fault and finally." /// internal static string CannotHaveFaultAndFinally { get { return "Can not have fault and finally."; } } /// /// A string like "Fault already defined." /// internal static string FaultAlreadyDefined { get { return "Fault already defined."; } } /// /// A string like "Cannot create default value for type {0}." /// internal static string CantCreateDefaultTypeFor(object p0) { return FormatString("Cannot create default value for type {0}.", p0); } /// /// A string like "Unhandled convert: {0}" /// internal static string UnhandledConvert(object p0) { return FormatString("Unhandled convert: {0}", p0); } /// /// A string like "{0}.{1} has no publiclly visible method." /// internal static string NoCallableMethods(object p0, object p1) { return FormatString("{0}.{1} has no publiclly visible method.", p0, p1); } /// /// A string like "Global/top-level local variable names must be unique." /// internal static string GlobalsMustBeUnique { get { return "Global/top-level local variable names must be unique."; } } /// /// A string like "Generating code from non-serializable CallSiteBinder." /// internal static string GenNonSerializableBinder { get { return "Generating code from non-serializable CallSiteBinder."; } } /// /// A string like "pecified path is invalid." /// internal static string InvalidPath { get { return "pecified path is invalid."; } } /// /// A string like "Dictionaries are not hashable." /// internal static string DictionaryNotHashable { get { return "Dictionaries are not hashable."; } } /// /// A string like "language already registered." /// internal static string LanguageRegistered { get { return "language already registered."; } } /// /// A string like "The method or operation is not implemented." /// internal static string MethodOrOperatorNotImplemented { get { return "The method or operation is not implemented."; } } /// /// A string like "No exception." /// internal static string NoException { get { return "No exception."; } } /// /// A string like "Extension type {0} must be public." /// internal static string ExtensionMustBePublic(object p0) { return FormatString("Extension type {0} must be public.", p0); } /// /// A string like "Already initialized." /// internal static string AlreadyInitialized { get { return "Already initialized."; } } /// /// A string like "CreateScopeExtension must return a scope extension." /// internal static string MustReturnScopeExtension { get { return "CreateScopeExtension must return a scope extension."; } } /// /// A string like "Invalid number of parameters for the service." /// internal static string InvalidParamNumForService { get { return "Invalid number of parameters for the service."; } } /// /// A string like "Invalid type of argument {0}; expecting {1}." /// internal static string InvalidArgumentType(object p0, object p1) { return FormatString("Invalid type of argument {0}; expecting {1}.", p0, p1); } /// /// A string like "Cannot change non-caching value." /// internal static string CannotChangeNonCachingValue { get { return "Cannot change non-caching value."; } } /// /// A string like "Local variable '{0}' referenced before assignment." /// internal static string ReferencedBeforeAssignment(object p0) { return FormatString("Local variable '{0}' referenced before assignment.", p0); } /// /// A string like "Field {0} is read-only" /// internal static string FieldReadonly(object p0) { return FormatString("Field {0} is read-only", p0); } /// /// A string like "Property {0} is read-only" /// internal static string PropertyReadonly(object p0) { return FormatString("Property {0} is read-only", p0); } /// /// A string like "Expected event from {0}.{1}, got event from {2}.{3}." /// internal static string UnexpectedEvent(object p0, object p1, object p2, object p3) { return FormatString("Expected event from {0}.{1}, got event from {2}.{3}.", p0, p1, p2, p3); } /// /// A string like "expected bound event, got {0}." /// internal static string ExpectedBoundEvent(object p0) { return FormatString("expected bound event, got {0}.", p0); } /// /// A string like "Expected type {0}, got {1}." /// internal static string UnexpectedType(object p0, object p1) { return FormatString("Expected type {0}, got {1}.", p0, p1); } /// /// A string like "can only write to member {0}." /// internal static string MemberWriteOnly(object p0) { return FormatString("can only write to member {0}.", p0); } /// /// A string like "No code to compile." /// internal static string NoCodeToCompile { get { return "No code to compile."; } } /// /// A string like "Invalid stream type: {0}." /// internal static string InvalidStreamType(object p0) { return FormatString("Invalid stream type: {0}.", p0); } /// /// A string like "Queue empty." /// internal static string QueueEmpty { get { return "Queue empty."; } } /// /// A string like "Enumeration has not started. Call MoveNext." /// internal static string EnumerationNotStarted { get { return "Enumeration has not started. Call MoveNext."; } } /// /// A string like "Enumeration already finished." /// internal static string EnumerationFinished { get { return "Enumeration already finished."; } } /// /// A string like "can't add another casing for identifier {0}" /// internal static string CantAddCasing(object p0) { return FormatString("can't add another casing for identifier {0}", p0); } /// /// A string like "can't add new identifier {0}" /// internal static string CantAddIdentifier(object p0) { return FormatString("can't add new identifier {0}", p0); } /// /// A string like "Type '{0}' doesn't provide a suitable public constructor or its implementation is faulty: {1}" /// internal static string InvalidCtorImplementation(object p0, object p1) { return FormatString("Type '{0}' doesn't provide a suitable public constructor or its implementation is faulty: {1}", p0, p1); } /// /// A string like "Invalid output directory." /// internal static string InvalidOutputDir { get { return "Invalid output directory."; } } /// /// A string like "Invalid assembly name or file extension." /// internal static string InvalidAsmNameOrExtension { get { return "Invalid assembly name or file extension."; } } /// /// A string like "Cannot emit constant {0} ({1})" /// internal static string CanotEmitConstant(object p0, object p1) { return FormatString("Cannot emit constant {0} ({1})", p0, p1); } /// /// A string like "No implicit cast from {0} to {1}" /// internal static string NoImplicitCast(object p0, object p1) { return FormatString("No implicit cast from {0} to {1}", p0, p1); } /// /// A string like "No explicit cast from {0} to {1}" /// internal static string NoExplicitCast(object p0, object p1) { return FormatString("No explicit cast from {0} to {1}", p0, p1); } /// /// A string like "name '{0}' not defined" /// internal static string NameNotDefined(object p0) { return FormatString("name '{0}' not defined", p0); } /// /// A string like "No default value for a given type." /// internal static string NoDefaultValue { get { return "No default value for a given type."; } } /// /// A string like "Specified language provider type is not registered." /// internal static string UnknownLanguageProviderType { get { return "Specified language provider type is not registered."; } } /// /// A string like "can't read from property" /// internal static string CantReadProperty { get { return "can't read from property"; } } /// /// A string like "can't write to property" /// internal static string CantWriteProperty { get { return "can't write to property"; } } /// /// A string like "Cannot create instance of {0} because it contains generic parameters" /// internal static string IllegalNew_GenericParams(object p0) { return FormatString("Cannot create instance of {0} because it contains generic parameters", p0); } /// /// A string like "Non-verifiable assembly generated: {0}:\nAssembly preserved as {1}\nError text:\n{2}\n" /// internal static string VerificationException(object p0, object p1, object p2) { return FormatString("Non-verifiable assembly generated: {0}:\nAssembly preserved as {1}\nError text:\n{2}\n", p0, p1, p2); } } /// /// Strongly-typed and parameterized exception factory. /// internal static partial class Error { /// /// ArgumentException with message like "Either code or target must be specified." /// internal static Exception MustHaveCodeOrTarget() { return new ArgumentException(Strings.MustHaveCodeOrTarget); } /// /// InvalidOperationException with message like "Type parameter is {0}. Expected a delegate." /// internal static Exception TypeParameterIsNotDelegate(object p0) { return new InvalidOperationException(Strings.TypeParameterIsNotDelegate(p0)); } /// /// InvalidOperationException with message like "Cannot cast from type '{0}' to type '{1}" /// internal static Exception InvalidCast(object p0, object p1) { return new InvalidOperationException(Strings.InvalidCast(p0, p1)); } /// /// InvalidOperationException with message like "unknown member type: '{0}'. " /// internal static Exception UnknownMemberType(object p0) { return new InvalidOperationException(Strings.UnknownMemberType(p0)); } /// /// InvalidOperationException with message like "RuleBuilder can only be used with delegates whose first argument is CallSite." /// internal static Exception FirstArgumentMustBeCallSite() { return new InvalidOperationException(Strings.FirstArgumentMustBeCallSite); } /// /// InvalidOperationException with message like "no instance for call." /// internal static Exception NoInstanceForCall() { return new InvalidOperationException(Strings.NoInstanceForCall); } /// /// InvalidOperationException with message like "Missing Test." /// internal static Exception MissingTest() { return new InvalidOperationException(Strings.MissingTest); } /// /// InvalidOperationException with message like "Missing Target." /// internal static Exception MissingTarget() { return new InvalidOperationException(Strings.MissingTarget); } /// /// TypeLoadException with message like "The operation requires a non-generic type for {0}, but this represents generic types only" /// internal static Exception NonGenericWithGenericGroup(object p0) { return new TypeLoadException(Strings.NonGenericWithGenericGroup(p0)); } /// /// ArgumentException with message like "Invalid operation: '{0}'" /// internal static Exception InvalidOperation(object p0) { return new ArgumentException(Strings.InvalidOperation(p0)); } /// /// InvalidOperationException with message like "Finally already defined." /// internal static Exception FinallyAlreadyDefined() { return new InvalidOperationException(Strings.FinallyAlreadyDefined); } /// /// InvalidOperationException with message like "Can not have fault and finally." /// internal static Exception CannotHaveFaultAndFinally() { return new InvalidOperationException(Strings.CannotHaveFaultAndFinally); } /// /// InvalidOperationException with message like "Fault already defined." /// internal static Exception FaultAlreadyDefined() { return new InvalidOperationException(Strings.FaultAlreadyDefined); } /// /// ArgumentException with message like "Cannot create default value for type {0}." /// internal static Exception CantCreateDefaultTypeFor(object p0) { return new ArgumentException(Strings.CantCreateDefaultTypeFor(p0)); } /// /// ArgumentException with message like "Unhandled convert: {0}" /// internal static Exception UnhandledConvert(object p0) { return new ArgumentException(Strings.UnhandledConvert(p0)); } /// /// InvalidOperationException with message like "{0}.{1} has no publiclly visible method." /// internal static Exception NoCallableMethods(object p0, object p1) { return new InvalidOperationException(Strings.NoCallableMethods(p0, p1)); } /// /// ArgumentException with message like "Global/top-level local variable names must be unique." /// internal static Exception GlobalsMustBeUnique() { return new ArgumentException(Strings.GlobalsMustBeUnique); } /// /// ArgumentException with message like "Generating code from non-serializable CallSiteBinder." /// internal static Exception GenNonSerializableBinder() { return new ArgumentException(Strings.GenNonSerializableBinder); } /// /// ArgumentException with message like "pecified path is invalid." /// internal static Exception InvalidPath() { return new ArgumentException(Strings.InvalidPath); } /// /// ArgumentTypeException with message like "Dictionaries are not hashable." /// internal static Exception DictionaryNotHashable() { return new ArgumentTypeException(Strings.DictionaryNotHashable); } /// /// InvalidOperationException with message like "language already registered." /// internal static Exception LanguageRegistered() { return new InvalidOperationException(Strings.LanguageRegistered); } /// /// NotImplementedException with message like "The method or operation is not implemented." /// internal static Exception MethodOrOperatorNotImplemented() { return new NotImplementedException(Strings.MethodOrOperatorNotImplemented); } /// /// InvalidOperationException with message like "No exception." /// internal static Exception NoException() { return new InvalidOperationException(Strings.NoException); } /// /// ArgumentException with message like "Extension type {0} must be public." /// internal static Exception ExtensionMustBePublic(object p0) { return new ArgumentException(Strings.ExtensionMustBePublic(p0)); } /// /// InvalidOperationException with message like "Already initialized." /// internal static Exception AlreadyInitialized() { return new InvalidOperationException(Strings.AlreadyInitialized); } /// /// InvalidImplementationException with message like "CreateScopeExtension must return a scope extension." /// internal static Exception MustReturnScopeExtension() { return new InvalidImplementationException(Strings.MustReturnScopeExtension); } /// /// ArgumentException with message like "Invalid number of parameters for the service." /// internal static Exception InvalidParamNumForService() { return new ArgumentException(Strings.InvalidParamNumForService); } /// /// ArgumentException with message like "Invalid type of argument {0}; expecting {1}." /// internal static Exception InvalidArgumentType(object p0, object p1) { return new ArgumentException(Strings.InvalidArgumentType(p0, p1)); } /// /// ArgumentException with message like "Cannot change non-caching value." /// internal static Exception CannotChangeNonCachingValue() { return new ArgumentException(Strings.CannotChangeNonCachingValue); } /// /// Microsoft.Scripting.Runtime.UnboundLocalException with message like "Local variable '{0}' referenced before assignment." /// internal static Exception ReferencedBeforeAssignment(object p0) { return new Microsoft.Scripting.Runtime.UnboundLocalException(Strings.ReferencedBeforeAssignment(p0)); } /// /// MissingMemberException with message like "Field {0} is read-only" /// internal static Exception FieldReadonly(object p0) { return new MissingMemberException(Strings.FieldReadonly(p0)); } /// /// MissingMemberException with message like "Property {0} is read-only" /// internal static Exception PropertyReadonly(object p0) { return new MissingMemberException(Strings.PropertyReadonly(p0)); } /// /// ArgumentException with message like "Expected event from {0}.{1}, got event from {2}.{3}." /// internal static Exception UnexpectedEvent(object p0, object p1, object p2, object p3) { return new ArgumentException(Strings.UnexpectedEvent(p0, p1, p2, p3)); } /// /// ArgumentTypeException with message like "expected bound event, got {0}." /// internal static Exception ExpectedBoundEvent(object p0) { return new ArgumentTypeException(Strings.ExpectedBoundEvent(p0)); } /// /// ArgumentTypeException with message like "Expected type {0}, got {1}." /// internal static Exception UnexpectedType(object p0, object p1) { return new ArgumentTypeException(Strings.UnexpectedType(p0, p1)); } /// /// MemberAccessException with message like "can only write to member {0}." /// internal static Exception MemberWriteOnly(object p0) { return new MemberAccessException(Strings.MemberWriteOnly(p0)); } /// /// InvalidOperationException with message like "No code to compile." /// internal static Exception NoCodeToCompile() { return new InvalidOperationException(Strings.NoCodeToCompile); } /// /// ArgumentException with message like "Invalid stream type: {0}." /// internal static Exception InvalidStreamType(object p0) { return new ArgumentException(Strings.InvalidStreamType(p0)); } /// /// InvalidOperationException with message like "Queue empty." /// internal static Exception QueueEmpty() { return new InvalidOperationException(Strings.QueueEmpty); } /// /// InvalidOperationException with message like "Enumeration has not started. Call MoveNext." /// internal static Exception EnumerationNotStarted() { return new InvalidOperationException(Strings.EnumerationNotStarted); } /// /// InvalidOperationException with message like "Enumeration already finished." /// internal static Exception EnumerationFinished() { return new InvalidOperationException(Strings.EnumerationFinished); } /// /// InvalidOperationException with message like "can't add another casing for identifier {0}" /// internal static Exception CantAddCasing(object p0) { return new InvalidOperationException(Strings.CantAddCasing(p0)); } /// /// InvalidOperationException with message like "can't add new identifier {0}" /// internal static Exception CantAddIdentifier(object p0) { return new InvalidOperationException(Strings.CantAddIdentifier(p0)); } /// /// ArgumentException with message like "Invalid output directory." /// internal static Exception InvalidOutputDir() { return new ArgumentException(Strings.InvalidOutputDir); } /// /// ArgumentException with message like "Invalid assembly name or file extension." /// internal static Exception InvalidAsmNameOrExtension() { return new ArgumentException(Strings.InvalidAsmNameOrExtension); } /// /// ArgumentException with message like "Cannot emit constant {0} ({1})" /// internal static Exception CanotEmitConstant(object p0, object p1) { return new ArgumentException(Strings.CanotEmitConstant(p0, p1)); } /// /// ArgumentException with message like "No implicit cast from {0} to {1}" /// internal static Exception NoImplicitCast(object p0, object p1) { return new ArgumentException(Strings.NoImplicitCast(p0, p1)); } /// /// ArgumentException with message like "No explicit cast from {0} to {1}" /// internal static Exception NoExplicitCast(object p0, object p1) { return new ArgumentException(Strings.NoExplicitCast(p0, p1)); } /// /// MissingMemberException with message like "name '{0}' not defined" /// internal static Exception NameNotDefined(object p0) { return new MissingMemberException(Strings.NameNotDefined(p0)); } /// /// ArgumentException with message like "No default value for a given type." /// internal static Exception NoDefaultValue() { return new ArgumentException(Strings.NoDefaultValue); } /// /// ArgumentException with message like "Specified language provider type is not registered." /// internal static Exception UnknownLanguageProviderType() { return new ArgumentException(Strings.UnknownLanguageProviderType); } /// /// InvalidOperationException with message like "can't read from property" /// internal static Exception CantReadProperty() { return new InvalidOperationException(Strings.CantReadProperty); } /// /// InvalidOperationException with message like "can't write to property" /// internal static Exception CantWriteProperty() { return new InvalidOperationException(Strings.CantWriteProperty); } /// /// ArgumentException with message like "Cannot create instance of {0} because it contains generic parameters" /// internal static Exception IllegalNew_GenericParams(object p0) { return new ArgumentException(Strings.IllegalNew_GenericParams(p0)); } /// /// System.Security.VerificationException with message like "Non-verifiable assembly generated: {0}:\nAssembly preserved as {1}\nError text:\n{2}\n" /// internal static Exception VerificationException(object p0, object p1, object p2) { return new System.Security.VerificationException(Strings.VerificationException(p0, p1, p2)); } } // *** END GENERATED CODE *** #endregion }