Export (0) Print
Expand All

WorkflowView.ShadowDepth Property

Gets or sets the ShadowDepth for the WorkflowView.

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

'Declaration
Public Property ShadowDepth As Integer

Property Value

Type: System.Int32
The shadow depth in pixels.

Use the ShadowDepth to get or adjust the shadow depth of text shown on the workflow design surface.

The following code example demonstrates how you can obtain an instance of the WorkflowView class using the GetView method. The code then sets several WorkflowView properties, including HScrollBar and VScrollBar, ShadowDepth, and calls the FitToScreenSize method.

Dim designerHost As IDesignerHost = CType(designSurface.GetService(GetType(IDesignerHost)), IDesignerHost)
If designerHost IsNot Nothing And designerHost.RootComponent IsNot Nothing Then 

    Dim rootDesigner As IRootDesigner = CType(designerHost.GetDesigner(designerHost.RootComponent), IRootDesigner)
    If rootDesigner IsNot Nothing Then
        UnloadWorkflow()

        Me.designSurface = designSurface
        Me.loader = loader
        Me.workflowView = CType(rootDesigner.GetView(ViewTechnology.Default), WorkflowView)
        Me.splitContainer1.Panel1.Controls.Add(Me.workflowView)
        Me.workflowView.Dock = DockStyle.Fill
        Me.workflowView.TabIndex = 1
        Me.workflowView.TabStop = True 
        Me.workflowView.HScrollBar.TabStop = False 
        Me.workflowView.VScrollBar.TabStop = False 
        Me.workflowView.ShadowDepth = 0
        Me.workflowView.EnableFitToScreen = True 
        Me.workflowView.Focus()

        Dim selectionService As ISelectionService = CType(GetService(GetType(ISelectionService)), ISelectionService)
        Dim changeService As IComponentChangeService = CType(GetService(GetType(IComponentChangeService)), IComponentChangeService)

        If selectionService IsNot Nothing Then 
            AddHandler selectionService.SelectionChanged, AddressOf OnSelectionChanged
        End If 

        If changeService IsNot Nothing Then 

            AddHandler changeService.ComponentAdded, AddressOf changeService_ComponentAdded
            AddHandler changeService.ComponentChanged, AddressOf changeService_ComponentChanged
            AddHandler changeService.ComponentRemoved, AddressOf changeService_ComponentRemoved
            AddHandler changeService.ComponentRename, AddressOf changeService_ComponentRename
        End If 
    End If 
End If

The UnloadWorkflow method that is called in the code above removes a currently loaded workflow in order to prepare for the loading of a new workflow and is implemented as follows:

Private Sub UnloadWorkflow()


    Dim designerHost As IDesignerHost = CType(GetService(GetType(IDesignerHost)), IDesignerHost)
    If designerHost IsNot Nothing And designerHost.Container.Components.Count > 0 Then
        WorkflowLoader.DestroyObjectGraphFromDesignerHost(designerHost, CType(designerHost.RootComponent, Activity))
    End If 

    If Me.designSurface IsNot Nothing Then 
        Me.designSurface.Dispose()
        Me.designSurface = Nothing 
    End If 


    If Me.workflowView IsNot Nothing Then
        Controls.Remove(Me.workflowView)
        Me.workflowView.Dispose()
        Me.workflowView = Nothing 
    End If 

End Sub

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft