Question

I use a workflow with custom activities:

public class isOkActivity : System.Workflow.ComponentModel.Activity

This is the base-Type of some of my activities.

In the designer-view of my workflow all of that public properties are shown (and executed).

One of that properties does some heavy database-procedures which I do not want to be executed each time I work in the Workflow.

Is there any way to hide that property for the designer?

enter image description here

Was it helpful?

Solution

Yes, there is a way: Change that property to a method. If it does some heavy database work it isn't supposed to be a property anyway as properties should be light in nature.

If you don't want to do that, you can at least stop the database queries if you are in design mode using Activity.DesignMode:

public bool CanRun
{
    get
    {
        if(DesignMode)
            return false;

        // your database stuff
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top