Edit

Share via


TypeCodeDomSerializer.GetInitializeMethod Method

Definition

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

protected:
 virtual System::CodeDom::CodeMemberMethod ^ GetInitializeMethod(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ manager, System::CodeDom::CodeTypeDeclaration ^ declaration, System::Object ^ value);
protected virtual System.CodeDom.CodeMemberMethod GetInitializeMethod (System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, System.CodeDom.CodeTypeDeclaration declaration, object value);
abstract member GetInitializeMethod : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * System.CodeDom.CodeTypeDeclaration * obj -> System.CodeDom.CodeMemberMethod
override this.GetInitializeMethod : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * System.CodeDom.CodeTypeDeclaration * obj -> System.CodeDom.CodeMemberMethod
Protected Overridable Function GetInitializeMethod (manager As IDesignerSerializationManager, declaration As CodeTypeDeclaration, value As Object) As CodeMemberMethod

Parameters

manager
IDesignerSerializationManager

The serialization manager to use for serialization.

declaration
CodeTypeDeclaration

The type declaration to use for serialization.

value
Object

The value to use for serialization.

Returns

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

Exceptions

manager, typeDecl, or value is null.

Remarks

The GetInitializeMethod 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 CodeObject.UserData dictionary to remember methods you have created. The typeDecl 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.

Applies to

See also