ErrorFacts
using System;
namespace Microsoft.CSharp.RuntimeBinder.Errors
{
internal static class ErrorFacts
{
public static string GetMessage(ErrorCode code)
{
string text = null;
switch (code) {
case ErrorCode.ERR_BadBinaryOps:
text = System.SR.BadBinaryOps;
break;
case ErrorCode.ERR_IntDivByZero:
text = System.SR.IntDivByZero;
break;
case ErrorCode.ERR_BadIndexLHS:
text = System.SR.BadIndexLHS;
break;
case ErrorCode.ERR_BadIndexCount:
text = System.SR.BadIndexCount;
break;
case ErrorCode.ERR_BadUnaryOp:
text = System.SR.BadUnaryOp;
break;
case ErrorCode.ERR_NoImplicitConv:
text = System.SR.NoImplicitConv;
break;
case ErrorCode.ERR_NoExplicitConv:
text = System.SR.NoExplicitConv;
break;
case ErrorCode.ERR_ConstOutOfRange:
text = System.SR.ConstOutOfRange;
break;
case ErrorCode.ERR_AmbigBinaryOps:
text = System.SR.AmbigBinaryOps;
break;
case ErrorCode.ERR_AmbigUnaryOp:
text = System.SR.AmbigUnaryOp;
break;
case ErrorCode.ERR_ValueCantBeNull:
text = System.SR.ValueCantBeNull;
break;
case ErrorCode.ERR_WrongNestedThis:
text = System.SR.WrongNestedThis;
break;
case ErrorCode.ERR_NoSuchMember:
text = System.SR.NoSuchMember;
break;
case ErrorCode.ERR_ObjectRequired:
text = System.SR.ObjectRequired;
break;
case ErrorCode.ERR_AmbigCall:
text = System.SR.AmbigCall;
break;
case ErrorCode.ERR_BadAccess:
text = System.SR.BadAccess;
break;
case ErrorCode.ERR_MethDelegateMismatch:
text = System.SR.MethDelegateMismatch;
break;
case ErrorCode.ERR_AssgLvalueExpected:
text = System.SR.AssgLvalueExpected;
break;
case ErrorCode.ERR_NoConstructors:
text = System.SR.NoConstructors;
break;
case ErrorCode.ERR_BadDelegateConstructor:
text = System.SR.BadDelegateConstructor;
break;
case ErrorCode.ERR_PropertyLacksGet:
text = System.SR.PropertyLacksGet;
break;
case ErrorCode.ERR_ObjectProhibited:
text = System.SR.ObjectProhibited;
break;
case ErrorCode.ERR_AssgReadonly:
text = System.SR.AssgReadonly;
break;
case ErrorCode.ERR_RefReadonly:
text = System.SR.RefReadonly;
break;
case ErrorCode.ERR_AssgReadonlyStatic:
text = System.SR.AssgReadonlyStatic;
break;
case ErrorCode.ERR_RefReadonlyStatic:
text = System.SR.RefReadonlyStatic;
break;
case ErrorCode.ERR_AssgReadonlyProp:
text = System.SR.AssgReadonlyProp;
break;
case ErrorCode.ERR_AbstractBaseCall:
text = System.SR.AbstractBaseCall;
break;
case ErrorCode.ERR_RefProperty:
text = System.SR.RefProperty;
break;
case ErrorCode.ERR_ManagedAddr:
text = System.SR.ManagedAddr;
break;
case ErrorCode.ERR_FixedNotNeeded:
text = System.SR.FixedNotNeeded;
break;
case ErrorCode.ERR_UnsafeNeeded:
text = System.SR.UnsafeNeeded;
break;
case ErrorCode.ERR_BadBoolOp:
text = System.SR.BadBoolOp;
break;
case ErrorCode.ERR_MustHaveOpTF:
text = System.SR.MustHaveOpTF;
break;
case ErrorCode.ERR_CheckedOverflow:
text = System.SR.CheckedOverflow;
break;
case ErrorCode.ERR_ConstOutOfRangeChecked:
text = System.SR.ConstOutOfRangeChecked;
break;
case ErrorCode.ERR_AmbigMember:
text = System.SR.AmbigMember;
break;
case ErrorCode.ERR_SizeofUnsafe:
text = System.SR.SizeofUnsafe;
break;
case ErrorCode.ERR_FieldInitRefNonstatic:
text = System.SR.FieldInitRefNonstatic;
break;
case ErrorCode.ERR_CallingFinalizeDepracated:
text = System.SR.CallingFinalizeDepracated;
break;
case ErrorCode.ERR_CallingBaseFinalizeDeprecated:
text = System.SR.CallingBaseFinalizeDeprecated;
break;
case ErrorCode.ERR_BadCastInFixed:
text = System.SR.BadCastInFixed;
break;
case ErrorCode.ERR_NoImplicitConvCast:
text = System.SR.NoImplicitConvCast;
break;
case ErrorCode.ERR_InaccessibleGetter:
text = System.SR.InaccessibleGetter;
break;
case ErrorCode.ERR_InaccessibleSetter:
text = System.SR.InaccessibleSetter;
break;
case ErrorCode.ERR_BadArity:
text = System.SR.BadArity;
break;
case ErrorCode.ERR_BadTypeArgument:
text = System.SR.BadTypeArgument;
break;
case ErrorCode.ERR_TypeArgsNotAllowed:
text = System.SR.TypeArgsNotAllowed;
break;
case ErrorCode.ERR_HasNoTypeVars:
text = System.SR.HasNoTypeVars;
break;
case ErrorCode.ERR_NewConstraintNotSatisfied:
text = System.SR.NewConstraintNotSatisfied;
break;
case ErrorCode.ERR_GenericConstraintNotSatisfiedRefType:
text = System.SR.GenericConstraintNotSatisfiedRefType;
break;
case ErrorCode.ERR_GenericConstraintNotSatisfiedNullableEnum:
text = System.SR.GenericConstraintNotSatisfiedNullableEnum;
break;
case ErrorCode.ERR_GenericConstraintNotSatisfiedNullableInterface:
text = System.SR.GenericConstraintNotSatisfiedNullableInterface;
break;
case ErrorCode.ERR_GenericConstraintNotSatisfiedTyVar:
text = System.SR.GenericConstraintNotSatisfiedTyVar;
break;
case ErrorCode.ERR_GenericConstraintNotSatisfiedValType:
text = System.SR.GenericConstraintNotSatisfiedValType;
break;
case ErrorCode.ERR_TypeVarCantBeNull:
text = System.SR.TypeVarCantBeNull;
break;
case ErrorCode.ERR_BadRetType:
text = System.SR.BadRetType;
break;
case ErrorCode.ERR_CantInferMethTypeArgs:
text = System.SR.CantInferMethTypeArgs;
break;
case ErrorCode.ERR_MethGrpToNonDel:
text = System.SR.MethGrpToNonDel;
break;
case ErrorCode.ERR_RefConstraintNotSatisfied:
text = System.SR.RefConstraintNotSatisfied;
break;
case ErrorCode.ERR_ValConstraintNotSatisfied:
text = System.SR.ValConstraintNotSatisfied;
break;
case ErrorCode.ERR_CircularConstraint:
text = System.SR.CircularConstraint;
break;
case ErrorCode.ERR_BaseConstraintConflict:
text = System.SR.BaseConstraintConflict;
break;
case ErrorCode.ERR_ConWithValCon:
text = System.SR.ConWithValCon;
break;
case ErrorCode.ERR_AmbigUDConv:
text = System.SR.AmbigUDConv;
break;
case ErrorCode.ERR_PredefinedTypeNotFound:
text = System.SR.PredefinedTypeNotFound;
break;
case ErrorCode.ERR_PredefinedTypeBadType:
text = System.SR.PredefinedTypeBadType;
break;
case ErrorCode.ERR_BindToBogus:
text = System.SR.BindToBogus;
break;
case ErrorCode.ERR_CantCallSpecialMethod:
text = System.SR.CantCallSpecialMethod;
break;
case ErrorCode.ERR_BogusType:
text = System.SR.BogusType;
break;
case ErrorCode.ERR_MissingPredefinedMember:
text = System.SR.MissingPredefinedMember;
break;
case ErrorCode.ERR_LiteralDoubleCast:
text = System.SR.LiteralDoubleCast;
break;
case ErrorCode.ERR_UnifyingInterfaceInstantiations:
text = System.SR.UnifyingInterfaceInstantiations;
break;
case ErrorCode.ERR_ConvertToStaticClass:
text = System.SR.ConvertToStaticClass;
break;
case ErrorCode.ERR_GenericArgIsStaticClass:
text = System.SR.GenericArgIsStaticClass;
break;
case ErrorCode.ERR_PartialMethodToDelegate:
text = System.SR.PartialMethodToDelegate;
break;
case ErrorCode.ERR_IncrementLvalueExpected:
text = System.SR.IncrementLvalueExpected;
break;
case ErrorCode.ERR_NoSuchMemberOrExtension:
text = System.SR.NoSuchMemberOrExtension;
break;
case ErrorCode.ERR_ValueTypeExtDelegate:
text = System.SR.ValueTypeExtDelegate;
break;
case ErrorCode.ERR_BadArgCount:
text = System.SR.BadArgCount;
break;
case ErrorCode.ERR_BadArgTypes:
text = System.SR.BadArgTypes;
break;
case ErrorCode.ERR_BadArgType:
text = System.SR.BadArgType;
break;
case ErrorCode.ERR_RefLvalueExpected:
text = System.SR.RefLvalueExpected;
break;
case ErrorCode.ERR_BadProtectedAccess:
text = System.SR.BadProtectedAccess;
break;
case ErrorCode.ERR_BindToBogusProp2:
text = System.SR.BindToBogusProp2;
break;
case ErrorCode.ERR_BindToBogusProp1:
text = System.SR.BindToBogusProp1;
break;
case ErrorCode.ERR_BadDelArgCount:
text = System.SR.BadDelArgCount;
break;
case ErrorCode.ERR_BadDelArgTypes:
text = System.SR.BadDelArgTypes;
break;
case ErrorCode.ERR_AssgReadonlyLocal:
text = System.SR.AssgReadonlyLocal;
break;
case ErrorCode.ERR_RefReadonlyLocal:
text = System.SR.RefReadonlyLocal;
break;
case ErrorCode.ERR_ReturnNotLValue:
text = System.SR.ReturnNotLValue;
break;
case ErrorCode.ERR_BadArgExtraRef:
text = System.SR.BadArgExtraRef;
break;
case ErrorCode.ERR_BadArgRef:
text = System.SR.BadArgRef;
break;
case ErrorCode.ERR_AssgReadonly2:
text = System.SR.AssgReadonly2;
break;
case ErrorCode.ERR_RefReadonly2:
text = System.SR.RefReadonly2;
break;
case ErrorCode.ERR_AssgReadonlyStatic2:
text = System.SR.AssgReadonlyStatic2;
break;
case ErrorCode.ERR_RefReadonlyStatic2:
text = System.SR.RefReadonlyStatic2;
break;
case ErrorCode.ERR_AssgReadonlyLocalCause:
text = System.SR.AssgReadonlyLocalCause;
break;
case ErrorCode.ERR_RefReadonlyLocalCause:
text = System.SR.RefReadonlyLocalCause;
break;
case ErrorCode.ERR_ThisStructNotInAnonMeth:
text = System.SR.ThisStructNotInAnonMeth;
break;
case ErrorCode.ERR_DelegateOnNullable:
text = System.SR.DelegateOnNullable;
break;
case ErrorCode.ERR_BadCtorArgCount:
text = System.SR.BadCtorArgCount;
break;
case ErrorCode.ERR_BadExtensionArgTypes:
text = System.SR.BadExtensionArgTypes;
break;
case ErrorCode.ERR_BadInstanceArgType:
text = System.SR.BadInstanceArgType;
break;
case ErrorCode.ERR_BadArgTypesForCollectionAdd:
text = System.SR.BadArgTypesForCollectionAdd;
break;
case ErrorCode.ERR_InitializerAddHasParamModifiers:
text = System.SR.InitializerAddHasParamModifiers;
break;
case ErrorCode.ERR_NonInvocableMemberCalled:
text = System.SR.NonInvocableMemberCalled;
break;
case ErrorCode.ERR_NamedArgumentSpecificationBeforeFixedArgument:
text = System.SR.NamedArgumentSpecificationBeforeFixedArgument;
break;
case ErrorCode.ERR_BadNamedArgument:
text = System.SR.BadNamedArgument;
break;
case ErrorCode.ERR_BadNamedArgumentForDelegateInvoke:
text = System.SR.BadNamedArgumentForDelegateInvoke;
break;
case ErrorCode.ERR_DuplicateNamedArgument:
text = System.SR.DuplicateNamedArgument;
break;
case ErrorCode.ERR_NamedArgumentUsedInPositional:
text = System.SR.NamedArgumentUsedInPositional;
break;
}
if (text == null)
return null;
return text;
}
public static string GetMessage(MessageID id)
{
return id.ToString();
}
}
}