WorkflowDesignerMessageFilter Class

 
Note: This API is now obsolete.

Provides a base class for all workflow message filters.

Namespace:   System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

System.Object
  System.Workflow.ComponentModel.Design.WorkflowDesignerMessageFilter

<ObsoleteAttribute("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>
Public MustInherit Class WorkflowDesignerMessageFilter
	Implements IDisposable

NameDescription
System_CAPS_protmethodWorkflowDesignerMessageFilter()

When implemented in a derived class, initializes an instance of a WorkflowDesignerMessageFilter.

NameDescription
System_CAPS_protpropertyMessageHitTestContext

Gets the HitTestInfo that describes the context of the WorkflowDesignerMessageFilter.

System_CAPS_protpropertyParentView

Gets the WorkflowView that is associated with the WorkflowDesignerMessageFilter.

NameDescription
System_CAPS_pubmethodDispose()

Releases the resources used by the WorkflowDesignerMessageFilter.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the WorkflowDesignerMessageFilter and optionally releases the managed resources.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Attempts to free resources by calling Dispose(false) before the object is reclaimed by garbage collection.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodInitialize(WorkflowView)

Initializes the WorkflowDesignerMessageFilter with the associated WorkflowView.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodOnDragDrop(DragEventArgs)

Occurs when the mouse button is released above an object during a drag operation.

System_CAPS_protmethodOnDragEnter(DragEventArgs)

Occurs when the mouse pointer enters the bounds of an object during a drag operation.

System_CAPS_protmethodOnDragLeave()

Occurs when the mouse pointer leaves the bounds of an object during a drag operation.

System_CAPS_protmethodOnDragOver(DragEventArgs)

Occurs when the mouse pointer moves within the bounds of an object during a drag operation.

System_CAPS_protmethodOnGiveFeedback(GiveFeedbackEventArgs)

Occurs during a drag operation.

System_CAPS_protmethodOnKeyDown(KeyEventArgs)

Occurs when a key is pressed.

System_CAPS_protmethodOnKeyUp(KeyEventArgs)

Occurs when a key is released.

System_CAPS_protmethodOnLayout(LayoutEventArgs)

Occurs when child objects should be repositioned.

System_CAPS_protmethodOnMouseCaptureChanged()

Occurs when the items selected by dragging the mouse changes.

System_CAPS_protmethodOnMouseDoubleClick(MouseEventArgs)

Occurs when you double-click the mouse.

System_CAPS_protmethodOnMouseDown(MouseEventArgs)

Occurs when a mouse button is clicked.

System_CAPS_protmethodOnMouseEnter(MouseEventArgs)

Occurs when the mouse pointer enters the bounds of an object.

System_CAPS_protmethodOnMouseHover(MouseEventArgs)

Occurs when the mouse pointer pauses above an object.

System_CAPS_protmethodOnMouseLeave()

Occurs when the mouse pointer leaves the bounds of an object.

System_CAPS_protmethodOnMouseMove(MouseEventArgs)

Occurs when the mouse pointer moves while within the bounds of an object.

System_CAPS_protmethodOnMouseUp(MouseEventArgs)

Occurs when the mouse button is released.

System_CAPS_protmethodOnMouseWheel(MouseEventArgs)

Occurs when the mouse wheel moves.

System_CAPS_protmethodOnPaint(PaintEventArgs, Rectangle, AmbientTheme)

Occurs when a paint message is received.

System_CAPS_protmethodOnPaintWorkflowAdornments(PaintEventArgs, Rectangle, AmbientTheme)

Occurs when the workflow should repaint its adornments.

System_CAPS_protmethodOnQueryContinueDrag(QueryContinueDragEventArgs)

Occurs during a drag operation.

System_CAPS_protmethodOnScroll(ScrollBar, Int32)

Occurs when a user scrolls in a workflow designer.

System_CAPS_protmethodOnShowContextMenu(Point)

Occurs when the workflow should show a context menu.

System_CAPS_protmethodOnThemeChange()

Occurs when the theme of the workflow changes.

System_CAPS_protmethodProcessMessage(Message)

Occurs when a raw Win32 message must be processed.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_noteNote

This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

The workflow designer provides a Strategy design pattern to create replaceable message filter objects to handle events.

Derive from the WorkflowDesignerMessageFilter class to create message filters that can respond to workflow designer events, such as drag operations, layout and paint operations, and other designer events. To add a custom message filter to the message filters chain, call the AddDesignerMessageFilter on the WorkflowView or override the MessageFilters virtual property on the custom root activity and add the custom message filter to the collection returned from the base class.

The following code example shows a custom designer message filter that derives from WorkflowDesignerMessageFilter. The class, named CustomMessageFilter, overrides a number of its base class methods including OnMouseDown, OnMouseMove, OnMouseUp, OnMouseDoubleClick, OnMouseEnter, OnMouseHover, OnMouseLeave, OnDragEnter, OnDragOver, and OnKeyDown.

This code example is part of the Basic Designer Hosting SDK Sample from the DesignerShell.cs file. For more information, seeBasic Designer Hosting.

    Friend NotInheritable Class CustomMessageFilter
        Inherits WorkflowDesignerMessageFilter

#Region "Members and Constructor"

        Private mouseDown As Boolean
        Private serviceProvider As IServiceProvider
        Private workflowView As WorkflowView
        Private loader As WorkflowDesignerLoader

        Public Sub New(ByVal provider As IServiceProvider, ByVal workflowView As WorkflowView, ByVal loader As WorkflowDesignerLoader)
            Me.serviceProvider = provider
            Me.workflowView = workflowView
            Me.loader = loader
        End Sub

#End Region

#Region "WorkflowDesignerMessageFilter Overridables"

        Protected Overrides Function OnMouseDown(ByVal eventArgs As System.Windows.Forms.MouseEventArgs) As Boolean
            ' Allow other components to process this event by not returning true.
            mouseDown = True
            Return False
        End Function

        Protected Overrides Function OnMouseMove(ByVal eventArgs As System.Windows.Forms.MouseEventArgs) As Boolean
            ' Allow other components to process this event by not returning true.
            If mouseDown Then
                workflowView.ScrollPosition = New Point(eventArgs.X, eventArgs.Y)
            End If
            Return False
        End Function

        Protected Overrides Function OnMouseUp(ByVal eventArgs As MouseEventArgs) As Boolean
            ' Allow other components to process this event by not returning true.
            mouseDown = False
            Return False
        End Function

        Protected Overrides Function OnMouseDoubleClick(ByVal eventArgs As MouseEventArgs) As Boolean
            mouseDown = False
            Return True
        End Function

        Protected Overrides Function OnMouseEnter(ByVal eventArgs As MouseEventArgs) As Boolean
            ' Allow other components to process this event by not returning true.
            mouseDown = False
            Return False
        End Function

        Protected Overrides Function OnMouseHover(ByVal eventArgs As MouseEventArgs) As Boolean
            ' Allow other components to process this event by not returning true.
            mouseDown = False
            Return False
        End Function

        Protected Overrides Function OnMouseLeave() As Boolean
            ' Allow other components to process this event by not returning true.
            mouseDown = False
            Return False
        End Function

        Protected Overrides Function OnMouseWheel(ByVal eventArgs As MouseEventArgs) As Boolean
            mouseDown = False
            Return True
        End Function

        Protected Overrides Function OnMouseCaptureChanged() As Boolean
            ' Allow other components to process this event by not returning true.
            mouseDown = False
            Return False
        End Function

        Protected Overrides Function OnDragEnter(ByVal eventArgs As DragEventArgs) As Boolean
            Return True
        End Function

        Protected Overrides Function OnDragOver(ByVal eventArgs As DragEventArgs) As Boolean
            Return True
        End Function

        Protected Overrides Function OnDragLeave() As Boolean
            Return True
        End Function

        Protected Overrides Function OnDragDrop(ByVal eventArgs As DragEventArgs) As Boolean
            Return True
        End Function

        Protected Overrides Function OnGiveFeedback(ByVal gfbevent As GiveFeedbackEventArgs) As Boolean
            Return True
        End Function

        Protected Overrides Function OnQueryContinueDrag(ByVal qcdevent As QueryContinueDragEventArgs) As Boolean
            Return True
        End Function

        Protected Overrides Function OnKeyDown(ByVal eventArgs As KeyEventArgs) As Boolean
            If eventArgs.KeyCode = Keys.Delete Then
                Dim selectionService As ISelectionService = CType(serviceProvider.GetService(GetType(ISelectionService)), ISelectionService)
                If selectionService IsNot Nothing AndAlso TypeOf selectionService.PrimarySelection Is CodeActivity Then
                    Dim codeActivityComponent As CodeActivity = CType(selectionService.PrimarySelection, CodeActivity)
                    Dim parentActivity As CompositeActivity = codeActivityComponent.Parent
                    If parentActivity IsNot Nothing Then
                        parentActivity.Activities.Remove(codeActivityComponent)
                        Me.ParentView.Update()
                    End If
                    loader.RemoveActivityFromDesigner(codeActivityComponent)
                End If
            End If
            Return True
        End Function

        Protected Overrides Function OnKeyUp(ByVal eventArgs As KeyEventArgs) As Boolean
            Return True
        End Function

        Protected Overrides Function OnShowContextMenu(ByVal menuPoint As Point) As Boolean
            Return True
        End Function

#End Region

    End Class

.NET Framework
Available since 3.0

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

Return to top
Show: