ErrorFacts
using System;
namespace Microsoft.CSharp.RuntimeBinder.Errors
{
internal static class ErrorFacts
{
public static string GetMessage(ErrorCode code)
{
switch (code) {
case ErrorCode.ERR_BadBinaryOps:
return System.SR.BadBinaryOps;
case ErrorCode.ERR_BadIndexLHS:
return System.SR.BadIndexLHS;
case ErrorCode.ERR_BadIndexCount:
return System.SR.BadIndexCount;
case ErrorCode.ERR_BadUnaryOp:
return System.SR.BadUnaryOp;
case ErrorCode.ERR_NoImplicitConv:
return System.SR.NoImplicitConv;
case ErrorCode.ERR_NoExplicitConv:
return System.SR.NoExplicitConv;
case ErrorCode.ERR_ConstOutOfRange:
return System.SR.ConstOutOfRange;
case ErrorCode.ERR_AmbigBinaryOps:
return System.SR.AmbigBinaryOps;
case ErrorCode.ERR_AmbigUnaryOp:
return System.SR.AmbigUnaryOp;
case ErrorCode.ERR_ValueCantBeNull:
return System.SR.ValueCantBeNull;
case ErrorCode.ERR_NoSuchMember:
return System.SR.NoSuchMember;
case ErrorCode.ERR_ObjectRequired:
return System.SR.ObjectRequired;
case ErrorCode.ERR_AmbigCall:
return System.SR.AmbigCall;
case ErrorCode.ERR_BadAccess:
return System.SR.BadAccess;
case ErrorCode.ERR_AssgLvalueExpected:
return System.SR.AssgLvalueExpected;
case ErrorCode.ERR_NoConstructors:
return System.SR.NoConstructors;
case ErrorCode.ERR_PropertyLacksGet:
return System.SR.PropertyLacksGet;
case ErrorCode.ERR_ObjectProhibited:
return System.SR.ObjectProhibited;
case ErrorCode.ERR_AssgReadonly:
return System.SR.AssgReadonly;
case ErrorCode.ERR_AssgReadonlyStatic:
return System.SR.AssgReadonlyStatic;
case ErrorCode.ERR_AssgReadonlyProp:
return System.SR.AssgReadonlyProp;
case ErrorCode.ERR_UnsafeNeeded:
return System.SR.UnsafeNeeded;
case ErrorCode.ERR_BadBoolOp:
return System.SR.BadBoolOp;
case ErrorCode.ERR_MustHaveOpTF:
return System.SR.MustHaveOpTF;
case ErrorCode.ERR_ConstOutOfRangeChecked:
return System.SR.ConstOutOfRangeChecked;
case ErrorCode.ERR_AmbigMember:
return System.SR.AmbigMember;
case ErrorCode.ERR_NoImplicitConvCast:
return System.SR.NoImplicitConvCast;
case ErrorCode.ERR_InaccessibleGetter:
return System.SR.InaccessibleGetter;
case ErrorCode.ERR_InaccessibleSetter:
return System.SR.InaccessibleSetter;
case ErrorCode.ERR_BadArity:
return System.SR.BadArity;
case ErrorCode.ERR_TypeArgsNotAllowed:
return System.SR.TypeArgsNotAllowed;
case ErrorCode.ERR_HasNoTypeVars:
return System.SR.HasNoTypeVars;
case ErrorCode.ERR_NewConstraintNotSatisfied:
return System.SR.NewConstraintNotSatisfied;
case ErrorCode.ERR_GenericConstraintNotSatisfiedRefType:
return System.SR.GenericConstraintNotSatisfiedRefType;
case ErrorCode.ERR_GenericConstraintNotSatisfiedNullableEnum:
return System.SR.GenericConstraintNotSatisfiedNullableEnum;
case ErrorCode.ERR_GenericConstraintNotSatisfiedNullableInterface:
return System.SR.GenericConstraintNotSatisfiedNullableInterface;
case ErrorCode.ERR_GenericConstraintNotSatisfiedValType:
return System.SR.GenericConstraintNotSatisfiedValType;
case ErrorCode.ERR_CantInferMethTypeArgs:
return System.SR.CantInferMethTypeArgs;
case ErrorCode.ERR_RefConstraintNotSatisfied:
return System.SR.RefConstraintNotSatisfied;
case ErrorCode.ERR_ValConstraintNotSatisfied:
return System.SR.ValConstraintNotSatisfied;
case ErrorCode.ERR_AmbigUDConv:
return System.SR.AmbigUDConv;
case ErrorCode.ERR_BindToBogus:
return System.SR.BindToBogus;
case ErrorCode.ERR_CantCallSpecialMethod:
return System.SR.CantCallSpecialMethod;
case ErrorCode.ERR_ConvertToStaticClass:
return System.SR.ConvertToStaticClass;
case ErrorCode.ERR_IncrementLvalueExpected:
return System.SR.IncrementLvalueExpected;
case ErrorCode.ERR_BadArgCount:
return System.SR.BadArgCount;
case ErrorCode.ERR_BadArgTypes:
return System.SR.BadArgTypes;
case ErrorCode.ERR_BadProtectedAccess:
return System.SR.BadProtectedAccess;
case ErrorCode.ERR_BindToBogusProp2:
return System.SR.BindToBogusProp2;
case ErrorCode.ERR_BindToBogusProp1:
return System.SR.BindToBogusProp1;
case ErrorCode.ERR_BadDelArgCount:
return System.SR.BadDelArgCount;
case ErrorCode.ERR_BadDelArgTypes:
return System.SR.BadDelArgTypes;
case ErrorCode.ERR_BadCtorArgCount:
return System.SR.BadCtorArgCount;
case ErrorCode.ERR_NonInvocableMemberCalled:
return System.SR.NonInvocableMemberCalled;
case ErrorCode.ERR_BadNamedArgument:
return System.SR.BadNamedArgument;
case ErrorCode.ERR_BadNamedArgumentForDelegateInvoke:
return System.SR.BadNamedArgumentForDelegateInvoke;
case ErrorCode.ERR_DuplicateNamedArgument:
return System.SR.DuplicateNamedArgument;
case ErrorCode.ERR_NamedArgumentUsedInPositional:
return System.SR.NamedArgumentUsedInPositional;
case ErrorCode.ERR_BadNonTrailingNamedArgument:
return System.SR.BadNonTrailingNamedArgument;
default:
return null;
}
}
public static string GetMessage(MessageID id)
{
return id.ToString();
}
}
}