diff options
Diffstat (limited to 'src/mscorlib/src/System/Reflection/MdConstant.cs')
-rw-r--r-- | src/mscorlib/src/System/Reflection/MdConstant.cs | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/mscorlib/src/System/Reflection/MdConstant.cs b/src/mscorlib/src/System/Reflection/MdConstant.cs index e59244f109..8e5b65724d 100644 --- a/src/mscorlib/src/System/Reflection/MdConstant.cs +++ b/src/mscorlib/src/System/Reflection/MdConstant.cs @@ -4,10 +4,10 @@ // +using System; + namespace System.Reflection { - using System; - internal static class MdConstant { public static unsafe Object GetValue(MetadataImport scope, int token, RuntimeTypeHandle fieldTypeHandle, bool raw) @@ -67,13 +67,13 @@ namespace System.Reflection case CorElementType.U8: defaultValue = buffer; break; - + default: - throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat")); - #endregion + throw new FormatException(SR.Arg_BadLiteralFormat); + #endregion } - return RuntimeType.CreateEnum(fieldType, defaultValue); + return RuntimeType.CreateEnum(fieldType, defaultValue); } else if (fieldType == typeof(DateTime)) { @@ -85,7 +85,7 @@ namespace System.Reflection case CorElementType.Void: return DBNull.Value; - + case CorElementType.I8: defaultValue = buffer; break; @@ -93,10 +93,10 @@ namespace System.Reflection case CorElementType.U8: defaultValue = buffer; break; - + default: - throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat")); - #endregion + throw new FormatException(SR.Arg_BadLiteralFormat); + #endregion } return new DateTime(defaultValue); @@ -136,14 +136,14 @@ namespace System.Reflection case CorElementType.U8: return (ulong)buffer; - - case CorElementType.Boolean : + + case CorElementType.Boolean: // The boolean value returned from the metadata engine is stored as a // BOOL, which actually maps to an int. We need to read it out as an int // to avoid problems on big-endian machines. return (*(int*)&buffer != 0); - case CorElementType.R4 : + case CorElementType.R4: return *(float*)&buffer; case CorElementType.R8: @@ -156,13 +156,12 @@ namespace System.Reflection case CorElementType.Class: return null; - + default: - throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat")); - #endregion + throw new FormatException(SR.Arg_BadLiteralFormat); + #endregion } } - } + } } - } |