// TODO: move to a place where we can share this with the compiler
 private static string GetFormatString(ExceptionStringID id)
 {
     switch (id)
     {
         case ExceptionStringID.ClassLoadGeneral:
             return SR.ClassLoad_General;
         case ExceptionStringID.ClassLoadExplicitGeneric:
             return SR.ClassLoad_ExplicitGeneric;
         case ExceptionStringID.ClassLoadBadFormat:
             return SR.ClassLoad_BadFormat;
         case ExceptionStringID.ClassLoadValueClassTooLarge:
             return SR.ClassLoad_ValueClassTooLarge;
         case ExceptionStringID.ClassLoadExplicitLayout:
             return SR.ClassLoad_ExplicitLayout;
         case ExceptionStringID.InvalidProgramSpecific:
             return SR.InvalidProgram_Specific;
         case ExceptionStringID.InvalidProgramVararg:
             return SR.InvalidProgram_Vararg;
         case ExceptionStringID.MissingField:
             return SR.EE_MissingField;
         case ExceptionStringID.MissingMethod:
             return SR.EE_MissingMethod;
         case ExceptionStringID.FileLoadErrorGeneric:
             return SR.IO_FileNotFound_FileName;
         default:
             Debug.Assert(false);
             throw new NotImplementedException();
     }
 }
 public InvalidProgramException(ExceptionStringID id, MethodDesc method)
     : base(id, Format.Method(method))
 {
 }
 public MissingFieldException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
Exemple #4
0
 protected internal MissingMemberException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
 private TypeLoadException(ExceptionStringID id, string typeName, string assemblyName)
     : base(id, new string[] { typeName, assemblyName })
 {
     TypeName     = typeName;
     AssemblyName = assemblyName;
 }
 public FileNotFoundException(ExceptionStringID id, string fileName)
     : base(id, fileName)
 {
 }
Exemple #7
0
 public static Exception CreateFileNotFoundException(ExceptionStringID id, string fileName)
 {
     throw new System.IO.FileNotFoundException(SR.Format(GetFormatString(id), fileName), fileName);
 }
Exemple #8
0
 public static Exception CreateBadImageFormatException(ExceptionStringID id)
 {
     return(new BadImageFormatException(GetFormatString(id)));
 }
Exemple #9
0
 public static void ThrowTypeLoadExceptionWithArgument(ExceptionStringID id, string className, string typeName, string messageArg)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName, messageArg);
 }
Exemple #10
0
 public static void ThrowTypeLoadException(ExceptionStringID id, string className, string typeName)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName);
 }
 public static Exception CreateInvalidProgramException(ExceptionStringID id, string methodName)
 {
     throw new InvalidProgramException(SR.Format(GetFormatString(id), methodName));
 }
 public static Exception CreateFileNotFoundException(ExceptionStringID id, string fileName)
 {
     throw new System.IO.FileNotFoundException(SR.Format(GetFormatString(id), fileName), fileName);
 }
 public static Exception CreateMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw new MissingMethodException(SR.Format(GetFormatString(id), methodName));
 }
 private static string GetExceptionString(ExceptionStringID id, string[] args)
 {
     // TODO: Share the strings and lookup logic with System.Private.CoreLib.
     return "[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + String.Join(", ", args);
 }
Exemple #15
0
 public static void ThrowMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingMethodException(id, methodName);
 }
 public TypeLoadException(ExceptionStringID id, MethodDesc method)
     : this(id, Format.Type(method.OwningType), Format.Module(GetOwningModule(method)), Format.Method(method))
 {
 }
Exemple #17
0
 public static void ThrowMissingFieldException(ExceptionStringID id, string fieldName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingFieldException(id, fieldName);
 }
Exemple #18
0
 public static Exception CreateMissingFieldException(ExceptionStringID id, string fieldName)
 {
     return(new MissingFieldException(SR.Format(GetFormatString(id), fieldName)));
 }
Exemple #19
0
 public static void ThrowFileNotFoundException(ExceptionStringID id, string fileName)
 {
     throw TypeLoaderExceptionHelper.CreateFileNotFoundException(id, fileName);
 }
 public TypeLoadException(ExceptionStringID id, TypeDesc type, string messageArg)
     : this(id, Format.Type(type), Format.OwningModule(type), messageArg)
 {
 }
Exemple #21
0
 public static void ThrowInvalidProgramException(ExceptionStringID id, string methodName)
 {
     throw TypeLoaderExceptionHelper.CreateInvalidProgramException(id, methodName);
 }
 public TypeSystemException(ExceptionStringID id, params string[] args)
 {
     StringID   = id;
     _arguments = args;
 }
 private TypeLoadException(ExceptionStringID id, string typeName, string assemblyName)
     : base(id, new string[] { typeName, assemblyName })
 {
     TypeName = typeName;
     AssemblyName = assemblyName;
 }
 public static void ThrowTypeLoadException(ExceptionStringID id, MethodDesc method)
 {
     ThrowTypeLoadException(id, Format.Type(method.OwningType), Format.OwningModule(method), Format.Method(method));
 }
 public TypeLoadException(ExceptionStringID id, TypeDesc type, string messageArg)
     : this(id, Format.Type(type), Format.OwningModule(type), messageArg)
 {
 }
 public static Exception CreateMissingFieldException(ExceptionStringID id, string fieldName)
 {
     return new MissingFieldException(SR.Format(GetFormatString(id), fieldName));
 }
 public TypeLoadException(ExceptionStringID id, TypeDesc type)
     : this(id, Format.Type(type), Format.OwningModule(type))
 {
 }
 public FileNotFoundException(ExceptionStringID id, string fileName)
     : base(id, fileName)
 {
 }
Exemple #29
0
 public static void ThrowTypeLoadException(ExceptionStringID id, string className, string typeName)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName);
 }
 public TypeSystemException(ExceptionStringID id, params string[] args)
 {
     StringID = id;
     _arguments = args;
 }
Exemple #31
0
 public static void ThrowTypeLoadExceptionWithArgument(ExceptionStringID id, string className, string typeName, string messageArg)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName, messageArg);
 }
 public TypeLoadException(ExceptionStringID id, string typeName, string assemblyName, string messageArg = null)
     : base(id, new string[] { typeName, assemblyName, messageArg })
 {
     TypeName = typeName;
     AssemblyName = assemblyName;
 }
Exemple #33
0
 public static void ThrowMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingMethodException(id, methodName);
 }
 protected internal MissingMemberException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
Exemple #35
0
 public static void ThrowMissingFieldException(ExceptionStringID id, string fieldName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingFieldException(id, fieldName);
 }
Exemple #36
0
 public static Exception CreateTypeLoadException(ExceptionStringID id, string typeName, string moduleName, string messageArg)
 {
     return(new TypeLoadException(SR.Format(GetFormatString(id), typeName, moduleName, messageArg), typeName));
 }
Exemple #37
0
 public static string GetFormatString(ExceptionStringID id)
 {
     return(s_stringResourceManager.Value.GetString(id.ToString(), CultureInfo.InvariantCulture));
 }
Exemple #38
0
 public static Exception CreateMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw new MissingMethodException(SR.Format(GetFormatString(id), methodName));
 }
 public static Exception CreateInvalidProgramException(ExceptionStringID id)
 {
     throw new InvalidProgramException(GetFormatString(id));
 }
Exemple #40
0
 public static Exception CreateInvalidProgramException(ExceptionStringID id, string methodName)
 {
     throw new InvalidProgramException(SR.Format(GetFormatString(id), methodName));
 }
 public static Exception CreateMarshalDirectiveException(ExceptionStringID id)
 {
     throw new MarshalDirectiveException(GetFormatString(id));
 }
 public TypeLoadException(ExceptionStringID id, TypeDesc type)
     : this(id, Format.Type(type), Format.OwningModule(type))
 {
 }
 internal MissingFieldException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
 public InvalidProgramException(ExceptionStringID id, MethodDesc method)
     : base(id, Format.Method(method))
 {
 }
 internal FileNotFoundException(ExceptionStringID id, string fileName)
     : base(id, fileName)
 {
 }
 private static string GetExceptionString(ExceptionStringID id, string[] args)
 {
     // TODO: Share the strings and lookup logic with System.Private.CoreLib.
     return("[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + String.Join(", ", args));
 }
 internal InvalidProgramException(ExceptionStringID id, string method)
     : base(id, method)
 {
 }
 public TypeLoadException(ExceptionStringID id, MethodDesc method)
     : this(id, Format.Type(method.OwningType), Format.OwningModule(method), Format.Method(method))
 {
 }
 internal InvalidProgramException(ExceptionStringID id)
     : base(id)
 {
 }
 public static void ThrowTypeLoadException(ExceptionStringID id, TypeDesc type)
 {
     ThrowTypeLoadException(id, Format.Type(type), Format.OwningModule(type));
 }
 internal TypeLoadException(ExceptionStringID id, string typeName, string assemblyName, string messageArg)
     : base(id, new string[] { typeName, assemblyName, messageArg })
 {
     TypeName     = typeName;
     AssemblyName = assemblyName;
 }
Exemple #52
0
 public MissingMethodException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
 public static Exception CreateTypeLoadException(ExceptionStringID id, string typeName, string moduleName, string messageArg)
 {
     return new TypeLoadException(SR.Format(GetFormatString(id), typeName, moduleName, messageArg), typeName);
 }