Reputation: 5124
Is there a way to know which members were added to an instance of SerializationInfo
in the GetDataObject
method of a ISerializable
object?
Upvotes: 3
Views: 1967
Reputation: 434
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 :)
Upvotes: 2
Reputation: 1063774
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
Upvotes: 8