.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 Core 3.0+
The page you are viewing does not exist in the .NET Core 3.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.v19.2.dll

Declaration

public event EventHandler<ActivitiesInformationEventArgs> QueryAvailableActivities
Public Event QueryAvailableActivities As EventHandler(Of ActivitiesInformationEventArgs)

Event Data

The QueryAvailableActivities event handler receives an argument of the ActivitiesInformationEventArgs type. 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.

See Also