August 2003
Intermediate to advanced
928 pages
32h 1m
English
FormatterServices
The methods of this sealed class provide some background
functionality to a formatter when serializing and deserializing
objects. For example, GetObjectData( ) creates an
array of System.Reflection.MemberInfo object data.
GetSerializableMembers( ) retrieves all the
serializable members of a given class.
PopulateObjectMembers( ) is the basic
deserialization method, using a MemberInfo array
of member names and an array of corresponding data values to
repopulate a specified object.
public sealed class FormatterServices { // Public Static Methods public static void CheckTypeSecurity(Typet, System.Runtime.Serialization.Formatters.TypeFilterLevelsecurityLevel); public static object[ ] GetObjectData(objectobj, System.Reflection.MemberInfo[ ]members); public static object GetSafeUninitializedObject(Typetype); public static MemberInfo[ ] GetSerializableMembers(Typetype); public static MemberInfo[ ] GetSerializableMembers(Typetype, StreamingContextcontext); public static Type GetTypeFromAssembly(System.Reflection.Assemblyassem, stringname); public static object GetUninitializedObject(Typetype); public static object PopulateObjectMembers(objectobj, System.Reflection.MemberInfo[ ]members, object[ ]data); }