.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET 5.0+
The page you are viewing does not exist in the .NET 5.0+ platform documentation. This link will take you to the parent topic of the current section.

WorkflowWindowsFormsModule.QueryAvailableActivities Event

Occurs prior to loading the rehosted workflow designer.

Namespace: DevExpress.ExpressApp.Workflow.Win

Assembly: DevExpress.ExpressApp.Workflow.Win.v21.2.dll

Declaration

public event EventHandler<ActivitiesInformationEventArgs> QueryAvailableActivities

Event Data

The QueryAvailableActivities event's data class is ActivitiesInformationEventArgs. The following properties provide information specific to this event:

Property Description
ActivitiesInformation Specifies activities that will be available in the rehosted workflow designer’s toolbox.

Remarks

Handle this event to customize the list of activities that will be available in the rehosted workflow designer’s toolbox. The following code snippet demonstrates how to remove a MyActivity activity from the toolbox.

using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Workflow;
using DevExpress.ExpressApp.Workflow.Win;
//...
public class MyWindowController : WindowController {
    WorkflowWindowsFormsModule workflowModuleWin;
    protected override void OnActivated() {
        base.OnActivated();
        workflowModuleWin = Application.Modules.FindModule<WorkflowWindowsFormsModule>();
        if (workflowModuleWin != null)
            workflowModuleWin.QueryAvailableActivities += OnQueryAvailableActivities;
    }
    void OnQueryAvailableActivities(object sender, ActivitiesInformationEventArgs e) {
        ActivityInformation myActivity = 
            e.ActivitiesInformation.Find(i => i.DisplayName == "MyActivity");
        e.ActivitiesInformation.Remove(myActivity);
    }
    protected override void OnDeactivated() {
        if (workflowModuleWin != null) {
            workflowModuleWin.QueryAvailableActivities -= OnQueryAvailableActivities;
            workflowModuleWin = null;
        }
        base.OnDeactivated();
    }
}

To see an example of handling this event to add new activities to the toolbox, refer to the Add Activities to the Workflow Designer Toolbox help topic.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the QueryAvailableActivities event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also