diff options
Diffstat (limited to 'src/mscorlib/src/System/MissingFieldException.cs')
-rw-r--r-- | src/mscorlib/src/System/MissingFieldException.cs | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/src/mscorlib/src/System/MissingFieldException.cs b/src/mscorlib/src/System/MissingFieldException.cs index 660e39cb47..5668f9e9b3 100644 --- a/src/mscorlib/src/System/MissingFieldException.cs +++ b/src/mscorlib/src/System/MissingFieldException.cs @@ -9,53 +9,62 @@ ** =============================================================================*/ -namespace System { - - using System; - using System.Runtime.Remoting; - using System.Runtime.Serialization; - using System.Runtime.CompilerServices; - using System.Globalization; + +using System; +using System.Runtime.Remoting; +using System.Runtime.Serialization; +using System.Runtime.CompilerServices; +using System.Globalization; + +namespace System +{ [Serializable] - public class MissingFieldException : MissingMemberException, ISerializable { - public MissingFieldException() - : base(Environment.GetResourceString("Arg_MissingFieldException")) { - SetErrorCode(__HResults.COR_E_MISSINGFIELD); + public class MissingFieldException : MissingMemberException, ISerializable + { + public MissingFieldException() + : base(SR.Arg_MissingFieldException) + { + HResult = __HResults.COR_E_MISSINGFIELD; } - - public MissingFieldException(String message) - : base(message) { - SetErrorCode(__HResults.COR_E_MISSINGFIELD); + + public MissingFieldException(String message) + : base(message) + { + HResult = __HResults.COR_E_MISSINGFIELD; } - - public MissingFieldException(String message, Exception inner) - : base(message, inner) { - SetErrorCode(__HResults.COR_E_MISSINGFIELD); + + public MissingFieldException(String message, Exception inner) + : base(message, inner) + { + HResult = __HResults.COR_E_MISSINGFIELD; } - protected MissingFieldException(SerializationInfo info, StreamingContext context) : base(info, context) { + protected MissingFieldException(SerializationInfo info, StreamingContext context) : base(info, context) + { } - + public override String Message { - get { - if (ClassName == null) { + get + { + if (ClassName == null) + { return base.Message; - } else { + } + else + { // do any desired fixups to classname here. - return Environment.GetResourceString("MissingField_Name", - (Signature != null ? FormatSignature(Signature) + " " : "") + - ClassName + "." + MemberName); + return SR.Format(SR.MissingField_Name, (Signature != null ? FormatSignature(Signature) + " " : "") + ClassName + "." + MemberName); } } } - + public MissingFieldException(String className, String fieldName) { - ClassName = className; - MemberName = fieldName; + ClassName = className; + MemberName = fieldName; } - + // If ClassName != null, Message will construct on the fly using it // and the other variables. This allows customization of the // format depending on the language environment. |