mscorlib(4.0.0.0) API with additions
MissingMemberException.cs
4 using System.Security;
5 
6 namespace System
7 {
10  [ComVisible(true)]
11  [__DynamicallyInvokable]
13  {
15  protected string ClassName;
16 
18  protected string MemberName;
19 
21  protected byte[] Signature;
22 
25  [__DynamicallyInvokable]
26  public override string Message
27  {
28  [SecuritySafeCritical]
29  [__DynamicallyInvokable]
30  get
31  {
32  if (ClassName == null)
33  {
34  return base.Message;
35  }
36  return Environment.GetResourceString("MissingMember_Name", ClassName + "." + MemberName + ((Signature != null) ? (" " + FormatSignature(Signature)) : ""));
37  }
38  }
39 
41  [__DynamicallyInvokable]
43  : base(Environment.GetResourceString("Arg_MissingMemberException"))
44  {
45  SetErrorCode(-2146233070);
46  }
47 
50  [__DynamicallyInvokable]
51  public MissingMemberException(string message)
52  : base(message)
53  {
54  SetErrorCode(-2146233070);
55  }
56 
60  [__DynamicallyInvokable]
61  public MissingMemberException(string message, Exception inner)
62  : base(message, inner)
63  {
64  SetErrorCode(-2146233070);
65  }
66 
71  : base(info, context)
72  {
73  ClassName = info.GetString("MMClassName");
74  MemberName = info.GetString("MMMemberName");
75  Signature = (byte[])info.GetValue("MMSignature", typeof(byte[]));
76  }
77 
78  [MethodImpl(MethodImplOptions.InternalCall)]
79  [SecurityCritical]
80  internal static extern string FormatSignature(byte[] signature);
81 
82  private MissingMemberException(string className, string memberName, byte[] signature)
83  {
84  ClassName = className;
85  MemberName = memberName;
86  Signature = signature;
87  }
88 
92  public MissingMemberException(string className, string memberName)
93  {
94  ClassName = className;
95  MemberName = memberName;
96  }
97 
102  [SecurityCritical]
103  public override void GetObjectData(SerializationInfo info, StreamingContext context)
104  {
105  if (info == null)
106  {
107  throw new ArgumentNullException("info");
108  }
109  base.GetObjectData(info, context);
110  info.AddValue("MMClassName", ClassName, typeof(string));
111  info.AddValue("MMMemberName", MemberName, typeof(string));
112  info.AddValue("MMSignature", Signature, typeof(byte[]));
113  }
114  }
115 }
MissingMemberException(string message, Exception inner)
Initializes a new instance of the T:System.MissingMemberException class with a specified error messag...
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
MissingMemberException(string message)
Initializes a new instance of the T:System.MissingMemberException class with a specified error messag...
string ClassName
Holds the class name of the missing member.
Definition: __Canon.cs:3
override void GetObjectData(SerializationInfo info, StreamingContext context)
Sets the T:System.Runtime.Serialization.SerializationInfo object with the class name,...
MissingMemberException()
Initializes a new instance of the T:System.MissingMemberException class.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
MissingMemberException(string className, string memberName)
Initializes a new instance of the T:System.MissingMemberException class with the specified class name...
MethodImplOptions
Defines the details of how a method is implemented.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
The exception that is thrown when there is an attempt to dynamically access a class member that does ...
Allows an object to control its own serialization and deserialization.
Definition: ISerializable.cs:8
byte [] Signature
Holds the signature of the missing member.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
MissingMemberException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.MissingMemberException class with serialized data.
string MemberName
Holds the name of the missing member.
Specifies that the class can be serialized.
The exception that is thrown when an attempt to access a class member fails.
override string? Message
Gets the text string showing the class name, the member name, and the signature of the missing member...