Export (0) Print
Expand All

ActivityDesigner Class

Note: This API is now obsolete.

Provides a mandatory base class for all activity designer components.

System.Object
  System.Workflow.ComponentModel.Design.ActivityDesigner
    System.Workflow.ComponentModel.Design.CompositeActivityDesigner

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

[ActivityDesignerThemeAttribute(typeof(ActivityDesignerTheme))]
[ObsoleteAttribute("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class ActivityDesigner : IDesignerFilter, 
	IToolboxUser, IPersistUIState, IWorkflowRootDesigner, IRootDesigner, IDesigner, 
	IDisposable

The ActivityDesigner type exposes the following members.

  NameDescription
Public methodActivityDesignerInitializes a new instance of the ActivityDesigner class.
Top

  NameDescription
Public propertyAccessibilityObjectGets an AccessibleObject that accessibility applications use to adjust the application UI for users who have impairments.
Public propertyActivityGets the Activity associated with the designer.
Public propertyBoundsGets a Rectangle which contains the value for the enclosing rectangle of the designer in logical coordinates.
Protected propertyDesignerActionsGets the array of actions associated with configuration errors.
Public propertyDesignerThemeGets the current designer theme for the activity designer.
Protected propertyEnableVisualResizingGets a value that indicates whether the activity designer can be resized in a free form designer.
Protected propertyGlyphsGets a collection of glyphs with which to adorn the designer.
Public propertyImageGets or sets the Image associated with the designer.
Protected propertyImageRectangleGets the value for the enclosing bounds of the image associated with the designer in logical coordinates.
Protected propertyInvokingDesignerGets or sets the designer of the activity that invokes the activity associated with the current activity designer.
Public propertyIsLockedGets a value that indicates whether the activity associated with the designer can be modified.
Public propertyIsPrimarySelectionGets a value that indicates whether the activity associated with the designer is the primary selection.
Public propertyIsRootDesignerGets a value that indicates whether the designer is a root designer.
Public propertyIsSelectedGets a value that indicates whether the activity associated with the designer is selected.
Public propertyIsVisibleGets a value that indicates whether the activity associated with the designer is visible on the workflow.
Public propertyLocationGets or sets the location of the designer in logical coordinates.
Protected propertyMessageFiltersGets a read-only collection of message filters that are associated with the activity designer.
Public propertyMinimumSizeGets the minimum size for the activity designer.
Public propertyParentDesignerGets the parent designer of the existing designer.
Protected propertyParentViewGets the workflow view that contains the current activity designer.
Protected propertyShowSmartTagGets a value that indicates whether the activity should show a smart tag.
Public propertySizeGets or sets the size of the ActivityDesigner.
Protected propertySmartTagRectangleGets the rectangle where the smart tag should be displayed.
Protected propertySmartTagVerbsGets a read-only collection of designer actions to associate with a smart tag on the activity designer.
Public propertyTextGets or sets the text to associate with the designer.
Protected propertyTextRectangleGets the value of the text rectangle in logical coordinates.
Protected propertyVerbsGets the collection of verbs to be associated with the designer.
Top

  NameDescription
Public methodCanBeParentedToReturns a value that indicates if a CompositeActivity can be set as the parent of the activity associated with the designer.
Protected methodCanConnectReturns a value that indicates whether a connection can be created between the specified connection point on the current activity designer and the specified connection point on a target activity designer.
Protected methodCreateViewCreates a workflow view for the current activity designer using the specified ViewTechnology.
Public methodDispose()Releases the unmanaged resources used by the ActivityDesigner and optionally releases the managed resources.
Protected methodDispose(Boolean)Releases the resources used by the ActivityDesigner class.
Protected methodDoDefaultActionPerforms the default UI action associated with the designer.
Public methodEnsureVisibleShifts the visible area of the screen to guarantee that the specified designer is visible.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeWhen overridden in a derived class, allows an object to clean up any resources deterministically. (Overrides Object.Finalize().)
Public methodGetConnectionPointsReturns a read-only collection of connection points for the activity designer along the specified DesignerEdges.
Protected methodGetConnectionsReturns a read-only collection of points that the designer uses for connections.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetPreviewImageGets the image of the activity designer on the specified Graphics.
Public methodStatic memberGetRootDesignerReturns the designer associated with the design surface of the workflow.
Protected methodGetServiceTries to retrieve the specified type of service from the design mode site for the activity associated with the designer.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodHitTestGets information about the ActivityDesigner at a specified point on the screen.
Protected methodInitializeInitializes the designer with the associated Activity.
Public methodInvalidate()Invalidates the designer.
Public methodInvalidate(Rectangle)Invalidates the specified rectangle on the designer.
Public methodStatic memberIsCommentedActivityReturns a value that indicates whether the current designer's activity is commented or is inside a commented activity.
Protected methodIsSupportedActivityTypeReturns a value that indicates whether the specified activity type is supported if the activity designer is a root designer.
Protected methodLoadViewStateLoads the view state of the designer from a binary stream.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnActivityChangedNotifies the ActivityDesigner when the activity it is associated with changes.
Protected methodOnBeginResizingNotifies the ActivityDesigner when a user starts to visually resize the activity designer when the designer is in a FreeFormActivityDesigner.
Protected methodOnConnectedNotifies the ActivityDesigner when a connection is established between two connection points.
Protected methodOnDragDropOccurs when the drag-drop operation is completed inside designer bounds.
Protected methodOnDragEnterOccurs when the drag-drop operation is in progress and the pointer enters the designer bounds.
Protected methodOnDragLeaveOccurs when the drag-drop operation is in progress and the pointer leaves the designer bounds.
Protected methodOnDragOverOccurs when the drag-drop operation is in progress and the pointer is within the designer bounds.
Protected methodOnEndResizingNotifies the ActivityDesigner when a user is finished visually resizing the activity designer when the designer is in a FreeFormActivityDesigner.
Protected methodOnExecuteDesignerActionNotifies the ActivityDesigner when the user clicks on the configuration errors associated with the designer.
Protected methodOnGiveFeedbackUpdates the visual cues for feedback supplied to the user when performing a drag operation.
Protected methodOnKeyDownOccurs when a key is pressed when the designer has the keyboard focus.
Protected methodOnKeyUpOccurs when a key is released when the designer has keyboard focus.
Protected methodOnLayoutPositionNotifies the ActivityDesigner when a user repositions its visual cues or child activity designers.
Protected methodOnLayoutSizeReturns the size of the visual cues or child activity designers on the ActivityDesigner.
Protected methodOnMouseCaptureChangedOccurs when the mouse capture changes.
Protected methodOnMouseDoubleClickOccurs when the mouse button is clicked multiple times on the designer.
Protected methodOnMouseDownOccurs when the mouse button is pressed when the pointer is in designer bounds.
Protected methodOnMouseDragBeginOccurs when the user starts to drag the mouse on the designer.
Protected methodOnMouseDragEndOccurs when the user stops dragging the mouse on the designer.
Protected methodOnMouseDragMoveOccurs on each movement of the mouse as the user drags the pointer over the designer.
Protected methodOnMouseEnterOccurs when the mouse first enters the designer bounds.
Protected methodOnMouseHoverOccurs when the pointer is in designer bounds.
Protected methodOnMouseLeaveOccurs when the pointer leaves designer bounds.
Protected methodOnMouseMoveOccurs when the pointer is moving in designer bounds.
Protected methodOnMouseUpOccurs when the mouse button is released when the pointer is in designer bounds.
Protected methodOnPaintDraws the visual representation of the activity at design time.
Protected methodOnProcessMessageAllows the designer to process raw Win32 messages.
Protected methodOnQueryContinueDragControls whether the drag operation should continue.
Protected methodOnResizingNotifies the ActivityDesigner when a user is visually resizing it at design time. The method is only called if the activity designer is a child of a FreeFormActivityDesigner.
Protected methodOnScrollNotifies the ActivityDesigner when a user changes the scroll position.
Protected methodOnShowSmartTagVerbsDisplays the designer verbs associated with a smart tag at the specified point.
Protected methodOnSmartTagVisibilityChangedNotifies the ActivityDesigner whether a smart tag should be displayed or hidden.
Protected methodOnThemeChangeNotifies the designer that the associated theme has changed.
Protected methodPerformLayoutUpdates the layout of the designer.
Protected methodPointToLogicalTransforms a point from screen coordinate system to the activity designer coordinate system.
Protected methodPointToScreenTransforms a point from the activity designer coordinate system to the screen coordinate system.
Protected methodPostFilterAttributesWhen overridden in a derived class, allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.
Protected methodPostFilterEventsWhen overridden in a derived class, allows the designer to change or remove items from the set of events that it exposes through a TypeDescriptor.
Protected methodPostFilterPropertiesWhen overridden in a derived class, allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.
Protected methodPreFilterAttributesWhen overridden in a derived class, allows a designer to add items to the set of attributes that it exposes through a TypeDescriptor.
Protected methodPreFilterEventsWhen overridden in a derived class, allows a designer to add items to the set of events that it exposes through a TypeDescriptor.
Protected methodPreFilterPropertiesWhen overridden in a derived class, allows a designer to add items to the set of properties that it exposes through a TypeDescriptor.
Protected methodRectangleToLogicalTransforms a rectangle from the screen coordinate system to the activity designer coordinate system.
Protected methodRectangleToScreenTransforms a rectangle from the activity designer coordinate system to the screen coordinate system.
Protected methodRefreshDesignerActionsRefreshes the configuration errors associated with the designer.
Protected methodRefreshDesignerVerbsRefreshes the activity designer verbs associated with the designer by calling the status handler.
Protected methodSaveViewStateStores the view state of the designer into a binary stream.
Protected methodShowInfoTip(String)Shows the specified info tip.
Protected methodShowInfoTip(String, String)Displays the info tip for the ActivityDesigner with the specified title and text.
Protected methodShowInPlaceTipDisplays the specified tool tip in the specified rectangle location.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate propertyIDesigner.ComponentGets the base component with which the activity designer is associated.
Explicit interface implemetationPrivate methodIDesigner.DoDefaultActionPerforms the default action associated with the designer.
Explicit interface implemetationPrivate methodIDesigner.InitializeInitializes the designer with the associated activity.
Explicit interface implemetationPrivate propertyIDesigner.VerbsGets the design-time verbs associated with the activity designer.
Explicit interface implemetationPrivate methodIDesignerFilter.PostFilterAttributesWhen overridden in a derived class, allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.
Explicit interface implemetationPrivate methodIDesignerFilter.PostFilterEventsWhen overridden in a derived class, allows a designer to change or remove items from the set of events that it exposes through a TypeDescriptor.
Explicit interface implemetationPrivate methodIDesignerFilter.PostFilterPropertiesWhen overridden in a derived class, allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.
Explicit interface implemetationPrivate methodIDesignerFilter.PreFilterAttributesWhen overridden in a derived class, allows a designer to add items to the set of attributes that it exposes through a TypeDescriptor.
Explicit interface implemetationPrivate methodIDesignerFilter.PreFilterEventsWhen overridden in a derived class, allows a designer to add items to the set of events that it exposes through a TypeDescriptor.
Explicit interface implemetationPrivate methodIDesignerFilter.PreFilterPropertiesWhen overridden in a derived class, allows a designer to add items to the set of properties that it exposes through a TypeDescriptor.
Explicit interface implemetationPrivate methodIPersistUIState.LoadViewStateRestores the view state from a binary stream.
Explicit interface implemetationPrivate methodIPersistUIState.SaveViewStateSaves the view state to a binary stream.
Explicit interface implemetationPrivate methodIRootDesigner.GetViewReturns a view object for the specified view technology.
Explicit interface implemetationPrivate propertyIRootDesigner.SupportedTechnologiesGets the array of technologies that the activity designer can support for its display.
Explicit interface implemetationPrivate methodIToolboxUser.GetToolSupportedDetermines whether the specified Toolbox item is supported by the current activity designer.
Explicit interface implemetationPrivate methodIToolboxUser.ToolPickedSelects the specified toolbox item.
Explicit interface implemetationPrivate propertyIWorkflowRootDesigner.InvokingDesignerGets or sets the CompositeActivityDesigner that requested the activity designer be initialized.
Explicit interface implemetationPrivate methodIWorkflowRootDesigner.IsSupportedActivityTypeReturns a value that indicates whether the specified type is supported on the current ActivityDesigner.
Explicit interface implemetationPrivate propertyIWorkflowRootDesigner.MessageFiltersGets any message filters associated with the activity designer.
Explicit interface implemetationPrivate propertyIWorkflowRootDesigner.SupportsLayoutPersistenceGets the value that indicates whether the actual workflow root designer supports the layout persistence.
Top

NoteNote

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

All activity designer components derive from ActivityDesigner. The ActivityDesigner provides a simple designer which lets the user visually design activities in the design mode.

ActivityDesigner provides a simple mechanism for the activities so they can participate in rendering the workflow on the design surface.

ActivityDesigner lets the user customize layout and drawing associated with the activity.

ActivityDesigner lets the user extend the metadata associated with the activity.

The following example shows a complete implementation of an ActivityDesigner for a custom activity. The designer has a flag that can be toggled to allow the base class ActivityDesigner to control the painting or to utilize the various methods the ActivityDesignerPaint class to draw the activity.

[ActivityDesignerTheme(typeof(CustomCompositeActivityDesignerTheme))]
public class CustomActivityDesigner : ActivityDesigner
{
    public override bool CanBeParentedTo(CompositeActivityDesigner parentActivityDesigner)
    {
        if (parentActivityDesigner.GetType().ToString() == "System.Workflow.Activities.IfElseBranchDesigner")
            return false;

        return true;
    }

    private ActivityDesignerVerbCollection verbs = null;

    protected override ActivityDesignerVerbCollection Verbs
    {
        get
        {
            if (this.verbs == null)
                CreateActivityVerbs();

            return this.verbs;
        }
    }

    private void CreateActivityVerbs()
    {
        this.verbs = new ActivityDesignerVerbCollection();

        ActivityDesignerVerb addBranchVerb = new ActivityDesignerVerb(this,
            DesignerVerbGroup.View, "Add New Parallel Branch", new EventHandler(OnAddParallelBranch));
        this.verbs.Clear();

        this.verbs.Add(addBranchVerb);
    }

    protected void OnAddParallelBranch(object sender, EventArgs e)
    {
        // Code for adding a new branch to the parallel activity goes here
    }

    protected override Rectangle ImageRectangle
    {
        get
        {
            Rectangle bounds = this.Bounds;
            Size sz = new Size(24, 24);

            Rectangle imageRect = new Rectangle();
            imageRect.X = bounds.Left + ((bounds.Width - sz.Width) / 2);
            imageRect.Y = bounds.Top + 4;
            imageRect.Size = sz;

            return imageRect;
        }
    }

    protected override Rectangle TextRectangle
    {
        get
        {
            return new Rectangle(
                this.Bounds.Left + 2,
                this.ImageRectangle.Bottom,
                this.Bounds.Width - 4,
                this.Bounds.Height - this.ImageRectangle.Height - 1);
        }
    }

    protected override void Initialize(Activity activity)
    {
        base.Initialize(activity);
        Bitmap bmp = Resources.ToolboxImage;
        bmp.MakeTransparent();
        this.Image = bmp;
    }

    readonly static Size BaseSize = new Size(64, 64);
    protected override Size OnLayoutSize(ActivityDesignerLayoutEventArgs e)
    {
        return BaseSize;
    }

    private bool expanded = true;
    private bool useBasePaint = false;

    public bool UseBasePaint
    {
        get { return this.useBasePaint; }
        set { this.useBasePaint = value; }
    }

    public bool Expanded
    {
        get { return this.expanded; }
        set { this.expanded = value; }
    }

    protected override void OnPaint(ActivityDesignerPaintEventArgs e)
    {
        if (this.UseBasePaint == true)
        {
            base.OnPaint(e);
            return;
        }

        DrawCustomActivity(e);
    }

    private void DrawCustomActivity(ActivityDesignerPaintEventArgs e)
    {
        Graphics graphics = e.Graphics;

        CompositeDesignerTheme compositeDesignerTheme = (CompositeDesignerTheme)e.DesignerTheme;

        ActivityDesignerPaint.DrawRoundedRectangle(graphics, compositeDesignerTheme.BorderPen, this.Bounds, compositeDesignerTheme.BorderWidth);

        string text = this.Text;
        Rectangle textRectangle = this.TextRectangle;
        if (!String.IsNullOrEmpty(text) && !textRectangle.IsEmpty)
        {
            ActivityDesignerPaint.DrawText(graphics, compositeDesignerTheme.Font, text, textRectangle, StringAlignment.Center, e.AmbientTheme.TextQuality, compositeDesignerTheme.ForegroundBrush);
        }

        System.Drawing.Image image = this.Image;
        Rectangle imageRectangle = this.ImageRectangle;
        if (image != null && !imageRectangle.IsEmpty)
        {
            ActivityDesignerPaint.DrawImage(graphics, image, imageRectangle, DesignerContentAlignment.Fill);
        }

        ActivityDesignerPaint.DrawExpandButton(graphics,
            new Rectangle(this.Location.X, this.Location.Y, 10, 10),
            this.Expanded,
            compositeDesignerTheme);
    }
}

.NET Framework

Supported in: 4, 3.5, 3.0
Obsolete (compiler warning) in 4.5.2
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5

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.

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