Validate Method
Collapse the table of content
Expand the table of content

ActivityValidator.Validate Method

Verifies that the given activity is valid.

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

public override ValidationErrorCollection Validate(
	ValidationManager manager,
	Object obj


Type: System.Workflow.ComponentModel.Compiler.ValidationManager

The ValidationManager associated with validation.

Type: System.Object

The Activity to be validated.

Return Value

Type: System.Workflow.ComponentModel.Compiler.ValidationErrorCollection
A ValidationErrorCollection object that contains any errors or warnings that occurred during validation.

This method calls ValidateProperties to validate the properties of the Activity.

This method only validates the uniqueness of the Name for the Activity if the Activity is not a root Activity.

The following example shows how to override the Validate method for an ActivityValidator used for a custom activity that has a single dependency property named Msg of type String. The custom validator ensures that the Msg property is set. If it is not set, the compiler displays an error when the Validate(ValidationManager, Object) method is called on the ActivityValidator and the compilation fails.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

© 2016 Microsoft