summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/MissingMemberException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/MissingMemberException.cs')
-rw-r--r--src/mscorlib/src/System/MissingMemberException.cs96
1 files changed, 53 insertions, 43 deletions
diff --git a/src/mscorlib/src/System/MissingMemberException.cs b/src/mscorlib/src/System/MissingMemberException.cs
index bb9be8827a..51150e113c 100644
--- a/src/mscorlib/src/System/MissingMemberException.cs
+++ b/src/mscorlib/src/System/MissingMemberException.cs
@@ -11,65 +11,75 @@
**
=============================================================================*/
-namespace System {
-
- using System;
- using System.Runtime.Remoting;
- using System.Runtime.Serialization;
- using System.Runtime.CompilerServices;
- using System.Globalization;
- using System.Runtime.Versioning;
- using System.Diagnostics.Contracts;
-
+
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Serialization;
+using System.Runtime.CompilerServices;
+using System.Globalization;
+using System.Runtime.Versioning;
+using System.Diagnostics.Contracts;
+
+namespace System
+{
[Serializable]
- public class MissingMemberException : MemberAccessException, ISerializable {
- public MissingMemberException()
- : base(Environment.GetResourceString("Arg_MissingMemberException")) {
- SetErrorCode(__HResults.COR_E_MISSINGMEMBER);
+ public class MissingMemberException : MemberAccessException, ISerializable
+ {
+ public MissingMemberException()
+ : base(SR.Arg_MissingMemberException)
+ {
+ HResult = __HResults.COR_E_MISSINGMEMBER;
}
-
- public MissingMemberException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_MISSINGMEMBER);
+
+ public MissingMemberException(String message)
+ : base(message)
+ {
+ HResult = __HResults.COR_E_MISSINGMEMBER;
}
-
- public MissingMemberException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_MISSINGMEMBER);
+
+ public MissingMemberException(String message, Exception inner)
+ : base(message, inner)
+ {
+ HResult = __HResults.COR_E_MISSINGMEMBER;
}
- protected MissingMemberException(SerializationInfo info, StreamingContext context) : base (info, context) {
+ protected MissingMemberException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
ClassName = (String)info.GetString("MMClassName");
MemberName = (String)info.GetString("MMMemberName");
Signature = (byte[])info.GetValue("MMSignature", typeof(byte[]));
}
-
+
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("MissingMember_Name",
- ClassName + "." + MemberName +
- (Signature != null ? " " + FormatSignature(Signature) : ""));
+ return SR.Format(SR.MissingMember_Name, ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : ""));
}
}
}
-
+
// Called to format signature
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern String FormatSignature(byte [] signature);
-
+ internal static extern String FormatSignature(byte[] signature);
+
public MissingMemberException(String className, String memberName)
{
- ClassName = className;
- MemberName = memberName;
+ ClassName = className;
+ MemberName = memberName;
}
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context) {
- if (info==null) {
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ if (info == null)
+ {
throw new ArgumentNullException(nameof(info));
}
Contract.EndContractBlock();
@@ -78,13 +88,13 @@ namespace System {
info.AddValue("MMMemberName", MemberName, typeof(String));
info.AddValue("MMSignature", Signature, typeof(byte[]));
}
-
-
+
+
// If ClassName != null, GetMessage will construct on the fly using it
// and the other variables. This allows customization of the
// format depending on the language environment.
- protected String ClassName;
- protected String MemberName;
- protected byte[] Signature;
+ protected String ClassName;
+ protected String MemberName;
+ protected byte[] Signature;
}
}