Creating a Custom ActivityValidator

By now, I’m sure you’ve seen the small red circle containing an exclamation mark that appears in activities that have unfinished configurations in the visual workflow designer. A Code activity that has nothing established for its ExecuteCode property will display this indicator, for example. What causes this?

The answer is that an activity validator forces this behavior. A validator examines the properties of its associated activity and inserts errors into an error collection if any properties are missing or invalid. The validator is asked to reevaluate the rules it applies to the activity properties when the state of the designer changes (that is, when new activities are added or properties change) and when ...

Get Microsoft® Windows® Workflow Foundation Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.