ValidationErrorCollection Class

Holds a collection of ValidationError objects.

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

public sealed class ValidationErrorCollection : Collection<ValidationError>
/** @attribute SerializableAttribute() */ 
public final class ValidationErrorCollection extends Collection<ValidationError>
public final class ValidationErrorCollection extends Collection<ValidationError>
Not applicable.

The following example shows how to create and manipulate validation errors and a validation error collection as part of a custom validation routine.

This code example is part of the Send E-mail SDK sample and is from the SendEMailActivity.cs file. For more information, see Send Mail Activity.

private void ValidateEmailProperties(ValidationErrorCollection validationErrors, SendEmailActivity activity)
    // Validate the To property
    if (String.IsNullOrEmpty(activity.To))

    else if (!activity.To.Contains("@"))
        validationErrors.Add(new ValidationError("Invalid To e-mail address", InvalidToAddress, false, SendEmailActivity.ToProperty.Name));


    // Validate the From property
    if (String.IsNullOrEmpty(activity.From))
    else if (!activity.From.Contains("@"))
        validationErrors.Add(new ValidationError("Invalid From e-mail address", InvalidFromAddress, false, SendEmailActivity.FromProperty.Name));



Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0