แก้ไข

แชร์ผ่าน


WorkflowMarkupSerializer.Serialize Method

Definition

Serializes an Object into extensible Application Markup Language (XAML) format.

Overloads

Serialize(XmlWriter, Object)

Serializes the specified Object into a workflow markup file or stream.

Serialize(IDesignerSerializationManager, XmlWriter, Object)

Serializes the specified Object into a workflow markup file or stream using the specified serialization manager.

Remarks

The functionality of WorkflowMarkupSerializer is dependent on functionality of other types outside of Windows Workflow Foundation. Based on the limitations of those other types, not all data types can be serialized through the WorkflowMarkupSerializer. The following is a list of some unsupported types.

Note

This is not an exhaustive and complete list of unsupported types.

Arrays (supported only if property is decorated with DesignerSerializationVisibility.Content attribute value)

Parameterless Constructors

Multidimensional Arrays

Generic types (Generic List and Dictionary types supported only if property is decorated with DesignerSerializationVisibility.Content attribute value)

Hashtable

Queue

Stack

XmlDocument

MailMessage

Bitmap

Enumeration Arrays

In addition to this list, any property decorated with both the ContentPropertyAttribute and the DesignerSerializationVisibilityAttribute cannot be serialized by WorkflowMarkupSerializer.

Serialize(XmlWriter, Object)

Serializes the specified Object into a workflow markup file or stream.

public:
 void Serialize(System::Xml::XmlWriter ^ writer, System::Object ^ obj);
public void Serialize (System.Xml.XmlWriter writer, object obj);
member this.Serialize : System.Xml.XmlWriter * obj -> unit
Public Sub Serialize (writer As XmlWriter, obj As Object)

Parameters

writer
XmlWriter

An XmlWriter that contains the stream or file used in serializing.

obj
Object

The object to be serialized.

Exceptions

writer is a null reference (Nothing in Visual Basic).

-or-

obj is a null reference (Nothing).

Remarks

You must serialize either a new instance of a workflow type or the root activity in a programmatically-created workflow to create workflow markup that can be used in CreateWorkflow to create a WorkflowInstance.

For more information about workflow markup, see Using Workflow Markup.

Applies to

Serialize(IDesignerSerializationManager, XmlWriter, Object)

Serializes the specified Object into a workflow markup file or stream using the specified serialization manager.

public:
 void Serialize(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ serializationManager, System::Xml::XmlWriter ^ writer, System::Object ^ obj);
public void Serialize (System.ComponentModel.Design.Serialization.IDesignerSerializationManager serializationManager, System.Xml.XmlWriter writer, object obj);
member this.Serialize : System.ComponentModel.Design.Serialization.IDesignerSerializationManager * System.Xml.XmlWriter * obj -> unit
Public Sub Serialize (serializationManager As IDesignerSerializationManager, writer As XmlWriter, obj As Object)

Parameters

serializationManager
IDesignerSerializationManager

An object that implements the IDesignerSerializationManager interface, such as DesignerSerializationManager.

writer
XmlWriter

An XmlWriter that contains the stream or file used in serializing.

obj
Object

The object to be serialized.

Exceptions

serializationManager is a null reference (Nothing in Visual Basic). -or-

writer is a null reference (Nothing in Visual Basic).

-or-

obj is a null reference (Nothing).

Remarks

You must serialize either a new instance of a workflow type or the root activity in a programmatically-created workflow to create workflow markup that can be used in CreateWorkflow to create a WorkflowInstance.

For more information on workflow markup, see Using Workflow Markup.

Applies to