Is there a way to know which members were added to an instance of SerializationInfo
in the GetDataObject
method of a ISerializable
object?
Yes: foreach
foreach(SerializationEntry entry in info) {...}
You would be forgiven for not noticing this, as it doesn't implement and IEnumerable
API, but: foreach
does not require that it does :)
See MSDN for what this provides per item: http://msdn.microsoft.com/en-us/library/system.runtime.serialization.serializationentry(v=vs.110).aspx
There doesn't appear to be a "contains" method. There is a GetEnumerator method that you can use to loop through it. But Marc's foreach suggestion is the better one :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With