当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET WorkflowView.AddDesignerMessageFilter方法代码示例

本文整理汇总了VB.NET中System.Workflow.ComponentModel.Design.WorkflowView.AddDesignerMessageFilter方法的典型用法代码示例。如果您正苦于以下问题:VB.NET WorkflowView.AddDesignerMessageFilter方法的具体用法?VB.NET WorkflowView.AddDesignerMessageFilter怎么用?VB.NET WorkflowView.AddDesignerMessageFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Workflow.ComponentModel.Design.WorkflowView的用法示例。


在下文中一共展示了WorkflowView.AddDesignerMessageFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: New

Public Sub New()

    Me.loaderValue = New Loader()

    ' Create a Workflow Design Surface
    Me.surface = New DesignSurface()
    Me.surface.BeginLoad(Me.loaderValue)

    ' Get the Workflow Designer Host
    If Me.surface.GetService(GetType(IDesignerHost)) IsNot Nothing AndAlso TypeOf Me.surface.GetService(GetType(IDesignerHost)) Is IDesignerHost Then
        Me.Host = CType(Me.surface.GetService(GetType(IDesignerHost)), IDesignerHost)
    Else
        Return
    End If

    ' Create a Sequential Workflow by using the Workflow Designer Host
    SequentialWorkflow = CType(Host.CreateComponent(GetType(SequentialWorkflowActivity)), SequentialWorkflowActivity)
    SequentialWorkflow.Name = "CustomOutlookWorkflow"

    ' Create a Workflow View on the Workflow Design Surface
    Me.workflowView = New WorkflowView(CType(Me.surface, IServiceProvider))

    ' Add a message filter to the workflow view, to support panning
    Dim filter As MessageFilter = New MessageFilter(CType(Me.surface, IServiceProvider), Me.workflowView)
    Me.workflowView.AddDesignerMessageFilter(filter)

    ' Activate the Workflow View
    Me.Host.Activate()

    Me.workflowView.Dock = DockStyle.Fill
    Me.Controls.Add(workflowView)
    Me.Dock = DockStyle.Fill
End Sub
开发者ID:VB.NET开发者,项目名称:System.Workflow.ComponentModel.Design,代码行数:33,代码来源:WorkflowView.AddDesignerMessageFilter

示例2: New

Friend Class MessageFilter
    Inherits WorkflowDesignerMessageFilter

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

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

    Protected Overrides Function OnMouseDown(ByVal eventArgs As System.Windows.Forms.MouseEventArgs) As Boolean
        ' Allow other components to process this event by not returning true.
        Me.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 (Me.mouseDown) Then
            Me.workflowView.ScrollPosition = New Point(eventArgs.X, eventArgs.Y)
        End If
        Return False
    End Function
    Protected Overrides Function OnMouseUp(ByVal eventArgs As System.Windows.Forms.MouseEventArgs) As Boolean
        ' Allow other components to process this event by not returning true.
        Me.mouseDown = False
        Return False
    End Function

    Protected Overrides Function OnMouseDoubleClick(ByVal eventArgs As System.Windows.Forms.MouseEventArgs) As Boolean
        Me.mouseDown = False
        Return True
    End Function

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

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

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

    Protected Overrides Function OnMouseWheel(ByVal eventArgs As System.Windows.Forms.MouseEventArgs) As Boolean
        Me.mouseDown = False
        Return True
    End Function

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

    Protected Overrides Function OnDragEnter(ByVal eventArgs As System.Windows.Forms.DragEventArgs) As Boolean
        Return True
    End Function

    Protected Overrides Function OnDragOver(ByVal eventArgs As System.Windows.Forms.DragEventArgs) As Boolean
        Return True
    End Function

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

    Protected Overrides Function OnDragDrop(ByVal eventArgs As System.Windows.Forms.DragEventArgs) As Boolean
        Return True
    End Function

    Protected Overrides Function OnGiveFeedback(ByVal eventArgs As System.Windows.Forms.GiveFeedbackEventArgs) As Boolean
        Return True
    End Function

    Protected Overrides Function OnQueryContinueDrag(ByVal eventArgs As System.Windows.Forms.QueryContinueDragEventArgs) As Boolean
        Return True
    End Function

    Protected Overrides Function OnKeyUp(ByVal eventArgs As System.Windows.Forms.KeyEventArgs) As Boolean
        Return True
    End Function

    Protected Overrides Function OnShowContextMenu(ByVal screenMenuPoint As System.Drawing.Point) As Boolean
        Return True
    End Function

    Protected Overrides Function OnKeyDown(ByVal eventArgs As System.Windows.Forms.KeyEventArgs) As Boolean
        If eventArgs.KeyCode = Keys.Delete Then
            Dim selectionService As ISelectionService = CType(Me.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
            End If
        End If
        Return True
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Workflow.ComponentModel.Design,代码行数:111,代码来源:WorkflowView.AddDesignerMessageFilter


注:本文中的System.Workflow.ComponentModel.Design.WorkflowView.AddDesignerMessageFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。