O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

FormatterServices

Synopsis

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 method object[] GetObjectData(object obj, 
        System.Reflection.MemberInfo[] members);  
   public static method MemberInfo[] GetSerializableMembers(Type type);  
   public static method MemberInfo[] GetSerializableMembers(
        Type type, StreamingContext context);  
   public static method Type GetTypeFromAssembly(
        System.Reflection.Assembly assem, string name);  
   public static method object GetUninitializedObject(Type type);  
   public static method object PopulateObjectMembers(
        object obj, System.Reflection.MemberInfo[] members, 
        object[] data);  
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required