ISerializable and protected constructor

  • Thread starter Thread starter herc
  • Start date Start date
H

herc

Here is what MSDN says about the constructor that is needed when
implementing the ISerializable interface:

"The ISerializable interface implies a constructor with the signature
constructor (SerializationInfo information, StreamingContext context).
At deserialization time, the current constructor is called only after
the data in the SerializationInfo has been deserialized by the
formatter. In general, this constructor should be protected if the
class is not sealed."

Now, MSDN says this about the protected keyword:

"A protected member is accessible within its class and by derived
classes."

How is .Net calling this constructor? Just wondering;)
 
herc said:
Here is what MSDN says about the constructor that is needed when
implementing the ISerializable interface:

"The ISerializable interface implies a constructor with the signature
constructor (SerializationInfo information, StreamingContext context).
At deserialization time, the current constructor is called only after
the data in the SerializationInfo has been deserialized by the
formatter. In general, this constructor should be protected if the
class is not sealed."

Now, MSDN says this about the protected keyword:

"A protected member is accessible within its class and by derived
classes."

How is .Net calling this constructor? Just wondering;)

Reflection.
Type.GetConstructor(Type[]) + ConstructorInfo.Invoke(object[])

Mark
 
Back
Top