Exemplo n.º 1
0
 // 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();
     }
 }
Exemplo n.º 2
0
 public InvalidProgramException(ExceptionStringID id, MethodDesc method)
     : base(id, Format.Method(method))
 {
 }
Exemplo n.º 3
0
 public MissingFieldException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
Exemplo n.º 4
0
 protected internal MissingMemberException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
Exemplo n.º 5
0
 private TypeLoadException(ExceptionStringID id, string typeName, string assemblyName)
     : base(id, new string[] { typeName, assemblyName })
 {
     TypeName     = typeName;
     AssemblyName = assemblyName;
 }
Exemplo n.º 6
0
 public FileNotFoundException(ExceptionStringID id, string fileName)
     : base(id, fileName)
 {
 }
Exemplo n.º 7
0
 public static Exception CreateFileNotFoundException(ExceptionStringID id, string fileName)
 {
     throw new System.IO.FileNotFoundException(SR.Format(GetFormatString(id), fileName), fileName);
 }
Exemplo n.º 8
0
 public static Exception CreateBadImageFormatException(ExceptionStringID id)
 {
     return(new BadImageFormatException(GetFormatString(id)));
 }
Exemplo n.º 9
0
 public static void ThrowTypeLoadExceptionWithArgument(ExceptionStringID id, string className, string typeName, string messageArg)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName, messageArg);
 }
Exemplo n.º 10
0
 public static void ThrowTypeLoadException(ExceptionStringID id, string className, string typeName)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName);
 }
Exemplo n.º 11
0
 public static Exception CreateInvalidProgramException(ExceptionStringID id, string methodName)
 {
     throw new InvalidProgramException(SR.Format(GetFormatString(id), methodName));
 }
Exemplo n.º 12
0
 public static Exception CreateFileNotFoundException(ExceptionStringID id, string fileName)
 {
     throw new System.IO.FileNotFoundException(SR.Format(GetFormatString(id), fileName), fileName);
 }
Exemplo n.º 13
0
 public static Exception CreateMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw new MissingMethodException(SR.Format(GetFormatString(id), methodName));
 }
Exemplo n.º 14
0
 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);
 }
Exemplo n.º 15
0
 public static void ThrowMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingMethodException(id, methodName);
 }
Exemplo n.º 16
0
 public TypeLoadException(ExceptionStringID id, MethodDesc method)
     : this(id, Format.Type(method.OwningType), Format.Module(GetOwningModule(method)), Format.Method(method))
 {
 }
Exemplo n.º 17
0
 public static void ThrowMissingFieldException(ExceptionStringID id, string fieldName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingFieldException(id, fieldName);
 }
Exemplo n.º 18
0
 public static Exception CreateMissingFieldException(ExceptionStringID id, string fieldName)
 {
     return(new MissingFieldException(SR.Format(GetFormatString(id), fieldName)));
 }
Exemplo n.º 19
0
 public static void ThrowFileNotFoundException(ExceptionStringID id, string fileName)
 {
     throw TypeLoaderExceptionHelper.CreateFileNotFoundException(id, fileName);
 }
Exemplo n.º 20
0
 public TypeLoadException(ExceptionStringID id, TypeDesc type, string messageArg)
     : this(id, Format.Type(type), Format.OwningModule(type), messageArg)
 {
 }
Exemplo n.º 21
0
 public static void ThrowInvalidProgramException(ExceptionStringID id, string methodName)
 {
     throw TypeLoaderExceptionHelper.CreateInvalidProgramException(id, methodName);
 }
Exemplo n.º 22
0
 public TypeSystemException(ExceptionStringID id, params string[] args)
 {
     StringID   = id;
     _arguments = args;
 }
Exemplo n.º 23
0
 private TypeLoadException(ExceptionStringID id, string typeName, string assemblyName)
     : base(id, new string[] { typeName, assemblyName })
 {
     TypeName = typeName;
     AssemblyName = assemblyName;
 }
Exemplo n.º 24
0
 public static void ThrowTypeLoadException(ExceptionStringID id, MethodDesc method)
 {
     ThrowTypeLoadException(id, Format.Type(method.OwningType), Format.OwningModule(method), Format.Method(method));
 }
Exemplo n.º 25
0
 public TypeLoadException(ExceptionStringID id, TypeDesc type, string messageArg)
     : this(id, Format.Type(type), Format.OwningModule(type), messageArg)
 {
 }
Exemplo n.º 26
0
 public static Exception CreateMissingFieldException(ExceptionStringID id, string fieldName)
 {
     return new MissingFieldException(SR.Format(GetFormatString(id), fieldName));
 }
Exemplo n.º 27
0
 public TypeLoadException(ExceptionStringID id, TypeDesc type)
     : this(id, Format.Type(type), Format.OwningModule(type))
 {
 }
Exemplo n.º 28
0
 public FileNotFoundException(ExceptionStringID id, string fileName)
     : base(id, fileName)
 {
 }
Exemplo n.º 29
0
 public static void ThrowTypeLoadException(ExceptionStringID id, string className, string typeName)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName);
 }
Exemplo n.º 30
0
 public TypeSystemException(ExceptionStringID id, params string[] args)
 {
     StringID = id;
     _arguments = args;
 }
Exemplo n.º 31
0
 public static void ThrowTypeLoadExceptionWithArgument(ExceptionStringID id, string className, string typeName, string messageArg)
 {
     throw TypeLoaderExceptionHelper.CreateTypeLoadException(id, className, typeName, messageArg);
 }
Exemplo n.º 32
0
 public TypeLoadException(ExceptionStringID id, string typeName, string assemblyName, string messageArg = null)
     : base(id, new string[] { typeName, assemblyName, messageArg })
 {
     TypeName = typeName;
     AssemblyName = assemblyName;
 }
Exemplo n.º 33
0
 public static void ThrowMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingMethodException(id, methodName);
 }
Exemplo n.º 34
0
 protected internal MissingMemberException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
Exemplo n.º 35
0
 public static void ThrowMissingFieldException(ExceptionStringID id, string fieldName)
 {
     throw TypeLoaderExceptionHelper.CreateMissingFieldException(id, fieldName);
 }
Exemplo n.º 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));
 }
Exemplo n.º 37
0
 public static string GetFormatString(ExceptionStringID id)
 {
     return(s_stringResourceManager.Value.GetString(id.ToString(), CultureInfo.InvariantCulture));
 }
Exemplo n.º 38
0
 public static Exception CreateMissingMethodException(ExceptionStringID id, string methodName)
 {
     throw new MissingMethodException(SR.Format(GetFormatString(id), methodName));
 }
Exemplo n.º 39
0
 public static Exception CreateInvalidProgramException(ExceptionStringID id)
 {
     throw new InvalidProgramException(GetFormatString(id));
 }
Exemplo n.º 40
0
 public static Exception CreateInvalidProgramException(ExceptionStringID id, string methodName)
 {
     throw new InvalidProgramException(SR.Format(GetFormatString(id), methodName));
 }
Exemplo n.º 41
0
 public static Exception CreateMarshalDirectiveException(ExceptionStringID id)
 {
     throw new MarshalDirectiveException(GetFormatString(id));
 }
Exemplo n.º 42
0
 public TypeLoadException(ExceptionStringID id, TypeDesc type)
     : this(id, Format.Type(type), Format.OwningModule(type))
 {
 }
Exemplo n.º 43
0
 internal MissingFieldException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
Exemplo n.º 44
0
 public InvalidProgramException(ExceptionStringID id, MethodDesc method)
     : base(id, Format.Method(method))
 {
 }
Exemplo n.º 45
0
 internal FileNotFoundException(ExceptionStringID id, string fileName)
     : base(id, fileName)
 {
 }
Exemplo n.º 46
0
 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));
 }
Exemplo n.º 47
0
 internal InvalidProgramException(ExceptionStringID id, string method)
     : base(id, method)
 {
 }
Exemplo n.º 48
0
 public TypeLoadException(ExceptionStringID id, MethodDesc method)
     : this(id, Format.Type(method.OwningType), Format.OwningModule(method), Format.Method(method))
 {
 }
Exemplo n.º 49
0
 internal InvalidProgramException(ExceptionStringID id)
     : base(id)
 {
 }
Exemplo n.º 50
0
 public static void ThrowTypeLoadException(ExceptionStringID id, TypeDesc type)
 {
     ThrowTypeLoadException(id, Format.Type(type), Format.OwningModule(type));
 }
Exemplo n.º 51
0
 internal TypeLoadException(ExceptionStringID id, string typeName, string assemblyName, string messageArg)
     : base(id, new string[] { typeName, assemblyName, messageArg })
 {
     TypeName     = typeName;
     AssemblyName = assemblyName;
 }
Exemplo n.º 52
0
 public MissingMethodException(ExceptionStringID id, params string[] args)
     : base(id, args)
 {
 }
Exemplo n.º 53
0
 public static Exception CreateTypeLoadException(ExceptionStringID id, string typeName, string moduleName, string messageArg)
 {
     return new TypeLoadException(SR.Format(GetFormatString(id), typeName, moduleName, messageArg), typeName);
 }