System.Design 2.0.0.0 System.ComponentModel.Design.Serialization.CodeDomSerializerBase

The class performs the same tasks as a , but serializing an object through this class defines a new type.

Serializes an object to a new type.

- Constructor
  2.0.0.0
  To be added.

  Initializes a new instance of the class.

- Method
  2.0.0.0
  System.Object `` ``

  The method deserializes a previously serialized code type declaration. The following table shows the tasks default implementation performs.

  Task

  Description

  Case Sensitivity Checks

  The implementation searches for a service to decide if it should treat members as case sensitive or case insensitive.

  Statement Sorting

  All member variables and local variables from init methods are stored in a table. Then each statement in an init method is added to a statement collection grouped according to its left-hand side, so all statements assigning or operating on a particular variable are grouped under that variable. Variables that have no statements are discarded.

  Deserialization

  The statement collections for each variable are deserialized according to the variable.

  The following table shows the services the method requires.

  Service

  Description

  While not strictly necessary, the service, if available, is used to determine if the serialization should be case sensitive or case insensitive.

  If an object does not exist in the name table during deserialization, a query for is made. If this query succeeds, the container is checked for the object. The container is also used as a stand-in for any container argument needed by components.

  Deserializes the given type declaration.

  The root object.

  The serialization manager to use for serialization. Type declaration to use for serialization.
- Method
  2.0.0.0
  System.CodeDom.CodeMemberMethod `` `` ``

  The method returns the method to emit all of the initialization code for the given member. The default implementation returns an empty constructor. If the same method is to be returned for multiple values, the same instance of the method should be returned. You can use the dictionary to remember methods you have created. The parameter can also be used to add infrastructure methods. For example, if you want to emit a separate method for each object, you need a single method that calls all of these methods in turn. This method can be added to the code type declaration as needed.

  Returns the method where statements used to serialize a member are stored.

  The method used to emit all of the initialization code for the given member.

  The serialization manager to use for serialization. The type declaration to use for serialization. The value to use for serialization.
- Method
  2.0.0.0
  System.CodeDom.CodeMemberMethod[] `` ``

  The default implementation returns a single-element array with the constructor in it.

  Returns an array of methods to be interpreted during deserialization.

  A array of methods to be interpreted during deserialization.

  The serialization manager to use for serialization. The type declaration to use for serialization.
- Method
  2.0.0.0
  System.CodeDom.CodeTypeDeclaration `` `` ``

  The method serializes the given root object and optional collection of members to create a new type definition. If the collection contains values, these values are serialized. Values themselves may serialize as either member variables or local variables. This determination is done by searching for an extender property on the object called GenerateMember. If true, a member is generated. Otherwise, a local variable is generated. For convenience, the collection can contain the root object. In this case, the root object is not also added as a member or local variable.

  The name of the returned type is taken from the root object’s name, if it was a named object. If not, a name is fabricated from the simple type name of the root class.

  The following table shows the tasks performed by the default implementation of the method.

  Task

  Description

  Context Seeding

  The serialization context is initialized with data including the and

  Member Serialization

  Next, walks all of the members and calls . Because serialization is done opportunistically in , this ensures that serialization is not done twice.

  Root Serialization

  Next, the root object is serialized and its statements are added to the statement collection.

  Statement Integration

  After all objects are serialized, the method orders the statements and adds them to a method returned from . Finally, a constructor is fabricated that calls all of the methods returned from .

  The following table shows the objects the method places on the context stack.

  Instance

  Description

  This serializer. Deriving classes may find it useful to add public properties to this class.

  The type being created. Most objects do not need direct access to this.

  Serializes the object root by creating a new type declaration that defines root.

  A that defines the root object.

  The serialization manager to use for serialization. The object to serialize. Optional collection of members. Can be null or empty.