ISerializable and protected constructor

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;)
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top