WorkflowMarkupSerializer.ShouldSerializeValue Method (WorkflowMarkupSerializationManager, Object)

 

Returns a value that indicates whether the WorkflowMarkupSerializer should serialize the specified Object.

Namespace:   System.Workflow.ComponentModel.Serialization
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

protected internal virtual bool ShouldSerializeValue(
	WorkflowMarkupSerializationManager serializationManager,
	object value
)

Parameters

serializationManager
Type: System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationManager

The WorkflowMarkupSerializationManager that manages the serialization process.

value
Type: System.Object

The Object to check.

Return Value

Type: System.Boolean

true to indicate value should be serialized; otherwise, false.

Exception Condition
ArgumentNullException

serializationManager contains a null reference (Nothing in Visual Basic).

ShouldSerializeValue is called by WorkflowMarkupSerializer before it serializes the specified object. The method returns false if value contains a null reference (Nothing) or if value and the DefaultValueAttribute of the current serialization context are equal.

You can override ShouldSerializeValue in a class that inherits from WorkflowMarkupSerializer to customize how to determine whether the specified object should be serialized.

.NET Framework
Available since 3.0
Return to top
Show: