WorkflowDesignerMessageFilter WorkflowDesignerMessageFilter WorkflowDesignerMessageFilter WorkflowDesignerMessageFilter Class

정의

경고

이 API는 현재 사용되지 않습니다.

모든 워크플로 메시지 필터의 기본 클래스를 제공합니다.Provides a base class for all workflow message filters.

public ref class WorkflowDesignerMessageFilter abstract : IDisposable
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public abstract class WorkflowDesignerMessageFilter : IDisposable
type WorkflowDesignerMessageFilter = class
    interface IDisposable
Public MustInherit Class WorkflowDesignerMessageFilter
Implements IDisposable
상속
WorkflowDesignerMessageFilterWorkflowDesignerMessageFilterWorkflowDesignerMessageFilterWorkflowDesignerMessageFilter
특성
구현

예제

다음 코드 예제에서는 WorkflowDesignerMessageFilter에서 파생되는 사용자 지정 디자이너 메시지 필터를 보여 줍니다The following code example shows a custom designer message filter that derives from WorkflowDesignerMessageFilter. CustomMessageFilter라는 클래스는 OnMouseDown, OnMouseMove, OnMouseUp, OnMouseDoubleClick, OnMouseEnter, OnMouseHover, OnMouseLeave, OnDragEnter, OnDragOver, OnKeyDown 등을 포함하여 다수의 기본 클래스 메서드를 재정의합니다.The class, named CustomMessageFilter, overrides a number of its base class methods including OnMouseDown, OnMouseMove, OnMouseUp, OnMouseDoubleClick, OnMouseEnter, OnMouseHover, OnMouseLeave, OnDragEnter, OnDragOver, and OnKeyDown.

이 코드 예제는 DesignerShell.cs 파일에 있는 Basic Designer Hosting SDK 샘플의 일부입니다.This code example is part of the Basic Designer Hosting SDK Sample from the DesignerShell.cs file. 자세한 내용은 Basic Designer Hosting합니다.For more information, see Basic Designer Hosting.

internal sealed class CustomMessageFilter : WorkflowDesignerMessageFilter
{
    #region Members and Constructor

    private bool mouseDown;
    private IServiceProvider serviceProvider;
    private WorkflowView workflowView;
    private WorkflowDesignerLoader loader;

    public CustomMessageFilter(IServiceProvider provider, WorkflowView workflowView, WorkflowDesignerLoader loader)
    {
        this.serviceProvider = provider;
        this.workflowView = workflowView;
        this.loader = loader;
    }

    #endregion

    #region MessageFilter Overridables

    protected override bool OnMouseDown(MouseEventArgs eventArgs)
    {
        //Allow other components to process this event by not returning true.
        this.mouseDown = true;
        return false;
    }

    protected override bool OnMouseMove(MouseEventArgs eventArgs)
    {
        //Allow other components to process this event by not returning true.
        if (mouseDown)
        {
            workflowView.ScrollPosition = new Point(eventArgs.X, eventArgs.Y);
        }
        return false;
    }

    protected override bool OnMouseUp(MouseEventArgs eventArgs)
    {
        //Allow other components to process this event by not returning true.
        mouseDown = false;
        return false;
    }

    protected override bool OnMouseDoubleClick(MouseEventArgs eventArgs)
    {
        mouseDown = false;
        return true;
    }

    protected override bool OnMouseEnter(MouseEventArgs eventArgs)
    {
        //Allow other components to process this event by not returning true.
        mouseDown = false;
        return false;
    }

    protected override bool OnMouseHover(MouseEventArgs eventArgs)
    {
        //Allow other components to process this event by not returning true.
        mouseDown = false;
        return false;
    }

    protected override bool OnMouseLeave()
    {
        //Allow other components to process this event by not returning true.
        mouseDown = false;
        return false;
    }

    protected override bool OnMouseWheel(MouseEventArgs eventArgs)
    {
        mouseDown = false;
        return true;
    }

    protected override bool OnMouseCaptureChanged()
    {
        //Allow other components to process this event by not returning true.
        mouseDown = false;
        return false;
    }

    protected override bool OnDragEnter(DragEventArgs eventArgs)
    {
        return true;
    }

    protected override bool OnDragOver(DragEventArgs eventArgs)
    {
        return true;
    }

    protected override bool OnDragLeave()
    {
        return true;
    }

    protected override bool OnDragDrop(DragEventArgs eventArgs)
    {
        return true;
    }

    protected override bool OnGiveFeedback(GiveFeedbackEventArgs gfbevent)
    {
        return true;
    }

    protected override bool OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
    {
        return true;
    }

    protected override bool OnKeyDown(KeyEventArgs eventArgs)
    {
        if (eventArgs.KeyCode == Keys.Delete)
        {
            ISelectionService selectionService = (ISelectionService)serviceProvider.GetService(typeof(ISelectionService));
            if (selectionService != null && selectionService.PrimarySelection is CodeActivity)
            {
                CodeActivity codeActivityComponent = (CodeActivity)selectionService.PrimarySelection;
                CompositeActivity parentActivity = codeActivityComponent.Parent;
                if (parentActivity != null)
                {
                    parentActivity.Activities.Remove(codeActivityComponent);
                    this.ParentView.Update();
                }
                loader.RemoveActivityFromDesigner(codeActivityComponent);

            }
        }
        return true;
    }

    protected override bool OnKeyUp(KeyEventArgs eventArgs)
    {
        return true;
    }

    protected override bool OnShowContextMenu(Point menuPoint)
    {
        return true;
    }

    #endregion
}
    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

설명

참고

이 자료에서는 더 이상 사용되지 않는 형식과 네임스페이스에 대해 설명합니다.This material discusses types and namespaces that are obsolete. 자세한 내용은 Deprecated Types in Windows Workflow Foundation 4.5(Windows Workflow Foundation 4.5에서 사용되지 않는 형식)를 참조하세요.For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

워크플로 디자이너는 이벤트를 처리할 대체 가능한 메시지 필터 개체를 만드는 Strategy 디자인 패턴을 제공합니다.The workflow designer provides a Strategy design pattern to create replaceable message filter objects to handle events.

WorkflowDesignerMessageFilter 클래스에서 파생시켜 끌기 작업, 레이아웃 및 그리기 작업, 기타 디자이너 이벤트와 같은 Workflow Designer 이벤트에 응답할 수 있는 메시지 필터를 만듭니다.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. 사용자 지정 메시지 필터를 메시지 필터 체인에 추가하려면 AddDesignerMessageFilter에서 WorkflowView를 호출하거나 사용자 지정 루트 동작에서 MessageFilters 가상 속성을 재정의하고 기본 클래스에서 반환된 컬렉션에 사용자 지정 메시지 필터를 추가합니다.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.

생성자

WorkflowDesignerMessageFilter() WorkflowDesignerMessageFilter() WorkflowDesignerMessageFilter() WorkflowDesignerMessageFilter()

파생 클래스에서 구현하는 경우 WorkflowDesignerMessageFilter의 인스턴스를 초기화합니다.When implemented in a derived class, initializes an instance of a WorkflowDesignerMessageFilter.

속성

MessageHitTestContext MessageHitTestContext MessageHitTestContext MessageHitTestContext

HitTestInfo의 컨텍스트를 설명하는 WorkflowDesignerMessageFilter를 가져옵니다.Gets the HitTestInfo that describes the context of the WorkflowDesignerMessageFilter.

ParentView ParentView ParentView ParentView

WorkflowView에 연결된 WorkflowDesignerMessageFilter를 가져옵니다.Gets the WorkflowView that is associated with the WorkflowDesignerMessageFilter.

메서드

Dispose() Dispose() Dispose() Dispose()

WorkflowDesignerMessageFilter에서 사용하는 리소스를 해제합니다.Releases the resources used by the WorkflowDesignerMessageFilter.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

WorkflowDesignerMessageFilter에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.Releases the unmanaged resources used by the WorkflowDesignerMessageFilter and optionally releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

가비지 컬렉션에서 개체를 회수하기 전에 Dispose(false)를 호출하여 리소스를 해제하려고 시도합니다.Attempts to free resources by calling Dispose(false) before the object is reclaimed by garbage collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
Initialize(WorkflowView) Initialize(WorkflowView) Initialize(WorkflowView) Initialize(WorkflowView)

연결된 WorkflowDesignerMessageFilter를 사용하여 WorkflowView를 초기화합니다.Initializes the WorkflowDesignerMessageFilter with the associated WorkflowView.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
OnDragDrop(DragEventArgs) OnDragDrop(DragEventArgs) OnDragDrop(DragEventArgs) OnDragDrop(DragEventArgs)

끌기 작업 중에 개체 위에서 마우스 단추를 놓을 때 발생합니다.Occurs when the mouse button is released above an object during a drag operation.

OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs) OnDragEnter(DragEventArgs)

끌기 작업 중에 마우스 포인터가 개체 범위에 들어올 때 발생합니다.Occurs when the mouse pointer enters the bounds of an object during a drag operation.

OnDragLeave() OnDragLeave() OnDragLeave() OnDragLeave()

끌기 작업 중에 마우스 포인터가 개체 범위 밖으로 나갈 때 발생합니다.Occurs when the mouse pointer leaves the bounds of an object during a drag operation.

OnDragOver(DragEventArgs) OnDragOver(DragEventArgs) OnDragOver(DragEventArgs) OnDragOver(DragEventArgs)

끌기 작업 중에 마우스 포인터가 개체 범위 내에서 이동할 때 발생합니다.Occurs when the mouse pointer moves within the bounds of an object during a drag operation.

OnGiveFeedback(GiveFeedbackEventArgs) OnGiveFeedback(GiveFeedbackEventArgs) OnGiveFeedback(GiveFeedbackEventArgs) OnGiveFeedback(GiveFeedbackEventArgs)

끌기 작업을 수행하는 동안 발생합니다.Occurs during a drag operation.

OnKeyDown(KeyEventArgs) OnKeyDown(KeyEventArgs) OnKeyDown(KeyEventArgs) OnKeyDown(KeyEventArgs)

키를 누를 때 발생합니다.Occurs when a key is pressed.

OnKeyUp(KeyEventArgs) OnKeyUp(KeyEventArgs) OnKeyUp(KeyEventArgs) OnKeyUp(KeyEventArgs)

키를 놓을 때 발생합니다.Occurs when a key is released.

OnLayout(LayoutEventArgs) OnLayout(LayoutEventArgs) OnLayout(LayoutEventArgs) OnLayout(LayoutEventArgs)

자식 개체의 위치를 바꿔야 할 때 발생합니다.Occurs when child objects should be repositioned.

OnMouseCaptureChanged() OnMouseCaptureChanged() OnMouseCaptureChanged() OnMouseCaptureChanged()

마우스를 끌어 선택한 항목이 변경되면 발생합니다.Occurs when the items selected by dragging the mouse changes.

OnMouseDoubleClick(MouseEventArgs) OnMouseDoubleClick(MouseEventArgs) OnMouseDoubleClick(MouseEventArgs) OnMouseDoubleClick(MouseEventArgs)

마우스를 두 번 클릭할 때 발생합니다.Occurs when you double-click the mouse.

OnMouseDown(MouseEventArgs) OnMouseDown(MouseEventArgs) OnMouseDown(MouseEventArgs) OnMouseDown(MouseEventArgs)

마우스 단추를 클릭할 때 발생합니다.Occurs when a mouse button is clicked.

OnMouseEnter(MouseEventArgs) OnMouseEnter(MouseEventArgs) OnMouseEnter(MouseEventArgs) OnMouseEnter(MouseEventArgs)

마우스 포인터가 개체 범위에 들어올 때 발생합니다.Occurs when the mouse pointer enters the bounds of an object.

OnMouseHover(MouseEventArgs) OnMouseHover(MouseEventArgs) OnMouseHover(MouseEventArgs) OnMouseHover(MouseEventArgs)

마우스 포인터가 개체 위에서 일시 중지할 때 발생합니다.Occurs when the mouse pointer pauses above an object.

OnMouseLeave() OnMouseLeave() OnMouseLeave() OnMouseLeave()

마우스 포인터가 개체 범위 밖으로 나갈 때 발생합니다.Occurs when the mouse pointer leaves the bounds of an object.

OnMouseMove(MouseEventArgs) OnMouseMove(MouseEventArgs) OnMouseMove(MouseEventArgs) OnMouseMove(MouseEventArgs)

마우스 포인터가 개체 범위 내에서 이동할 때 발생합니다.Occurs when the mouse pointer moves while within the bounds of an object.

OnMouseUp(MouseEventArgs) OnMouseUp(MouseEventArgs) OnMouseUp(MouseEventArgs) OnMouseUp(MouseEventArgs)

마우스 단추를 놓을 때 발생합니다.Occurs when the mouse button is released.

OnMouseWheel(MouseEventArgs) OnMouseWheel(MouseEventArgs) OnMouseWheel(MouseEventArgs) OnMouseWheel(MouseEventArgs)

마우스 휠이 움직일 때 발생합니다.Occurs when the mouse wheel moves.

OnPaint(PaintEventArgs, Rectangle, AmbientTheme) OnPaint(PaintEventArgs, Rectangle, AmbientTheme) OnPaint(PaintEventArgs, Rectangle, AmbientTheme) OnPaint(PaintEventArgs, Rectangle, AmbientTheme)

그리기 메시지를 받을 때 발생합니다.Occurs when a paint message is received.

OnPaintWorkflowAdornments(PaintEventArgs, Rectangle, AmbientTheme) OnPaintWorkflowAdornments(PaintEventArgs, Rectangle, AmbientTheme) OnPaintWorkflowAdornments(PaintEventArgs, Rectangle, AmbientTheme) OnPaintWorkflowAdornments(PaintEventArgs, Rectangle, AmbientTheme)

워크플로에서 장식을 다시 그려야 할 때 발생합니다.Occurs when the workflow should repaint its adornments.

OnQueryContinueDrag(QueryContinueDragEventArgs) OnQueryContinueDrag(QueryContinueDragEventArgs) OnQueryContinueDrag(QueryContinueDragEventArgs) OnQueryContinueDrag(QueryContinueDragEventArgs)

끌기 작업을 수행하는 동안 발생합니다.Occurs during a drag operation.

OnScroll(ScrollBar, Int32) OnScroll(ScrollBar, Int32) OnScroll(ScrollBar, Int32) OnScroll(ScrollBar, Int32)

사용자가 워크플로 디자이너에서 스크롤할 때 발생합니다.Occurs when a user scrolls in a workflow designer.

OnShowContextMenu(Point) OnShowContextMenu(Point) OnShowContextMenu(Point) OnShowContextMenu(Point)

워크플로에서 상황에 맞는 메뉴를 표시해야 할 때 발생합니다.Occurs when the workflow should show a context menu.

OnThemeChange() OnThemeChange() OnThemeChange() OnThemeChange()

워크플로의 테마를 변경할 때 발생합니다.Occurs when the theme of the workflow changes.

ProcessMessage(Message) ProcessMessage(Message) ProcessMessage(Message) ProcessMessage(Message)

원시 Win32 메시지를 처리해야 할 때 발생합니다.Occurs when a raw Win32 message must be processed.

ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

적용 대상

추가 정보