ActivityDesigner Class
TOC
Collapse the table of content
Expand the table of content

ActivityDesigner Class

 
Note: This API is now obsolete.

Provides a mandatory base class for all activity designer components.

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

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

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

NameDescription
System_CAPS_pubmethodActivityDesigner()

Initializes a new instance of the ActivityDesigner class.

NameDescription
System_CAPS_pubpropertyAccessibilityObject

Gets an AccessibleObject that accessibility applications use to adjust the application UI for users who have impairments.

System_CAPS_pubpropertyActivity

Gets the Activity associated with the designer.

System_CAPS_pubpropertyBounds

Gets a Rectangle which contains the value for the enclosing rectangle of the designer in logical coordinates.

System_CAPS_protpropertyDesignerActions

Gets the array of actions associated with configuration errors.

System_CAPS_pubpropertyDesignerTheme

Gets the current designer theme for the activity designer.

System_CAPS_protpropertyEnableVisualResizing

Gets a value that indicates whether the activity designer can be resized in a free form designer.

System_CAPS_protpropertyGlyphs

Gets a collection of glyphs with which to adorn the designer.

System_CAPS_pubpropertyImage

Gets or sets the Image associated with the designer.

System_CAPS_protpropertyImageRectangle

Gets the value for the enclosing bounds of the image associated with the designer in logical coordinates.

System_CAPS_protpropertyInvokingDesigner

Gets or sets the designer of the activity that invokes the activity associated with the current activity designer.

System_CAPS_pubpropertyIsLocked

Gets a value that indicates whether the activity associated with the designer can be modified.

System_CAPS_pubpropertyIsPrimarySelection

Gets a value that indicates whether the activity associated with the designer is the primary selection.

System_CAPS_pubpropertyIsRootDesigner

Gets a value that indicates whether the designer is a root designer.

System_CAPS_pubpropertyIsSelected

Gets a value that indicates whether the activity associated with the designer is selected.

System_CAPS_pubpropertyIsVisible

Gets a value that indicates whether the activity associated with the designer is visible on the workflow.

System_CAPS_pubpropertyLocation

Gets or sets the location of the designer in logical coordinates.

System_CAPS_protpropertyMessageFilters

Gets a read-only collection of message filters that are associated with the activity designer.

System_CAPS_pubpropertyMinimumSize

Gets the minimum size for the activity designer.

System_CAPS_pubpropertyParentDesigner

Gets the parent designer of the existing designer.

System_CAPS_protpropertyParentView

Gets the workflow view that contains the current activity designer.

System_CAPS_protpropertyShowSmartTag

Gets a value that indicates whether the activity should show a smart tag.

System_CAPS_pubpropertySize

Gets or sets the size of the ActivityDesigner.

System_CAPS_protpropertySmartTagRectangle

Gets the rectangle where the smart tag should be displayed.

System_CAPS_protpropertySmartTagVerbs

Gets a read-only collection of designer actions to associate with a smart tag on the activity designer.

System_CAPS_pubpropertyText

Gets or sets the text to associate with the designer.

System_CAPS_protpropertyTextRectangle

Gets the value of the text rectangle in logical coordinates.

System_CAPS_protpropertyVerbs

Gets the collection of verbs to be associated with the designer.

NameDescription
System_CAPS_pubmethodCanBeParentedTo(CompositeActivityDesigner)

Returns a value that indicates if a CompositeActivity can be set as the parent of the activity associated with the designer.

System_CAPS_protmethodCanConnect(ConnectionPoint, ConnectionPoint)

Returns 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.

System_CAPS_protmethodCreateView(ViewTechnology)

Creates a workflow view for the current activity designer using the specified ViewTechnology.

System_CAPS_pubmethodDispose()

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

System_CAPS_protmethodDispose(Boolean)

Releases the resources used by the ActivityDesigner class.

System_CAPS_protmethodDoDefaultAction()

Performs the default UI action associated with the designer.

System_CAPS_pubmethodEnsureVisible()

Shifts the visible area of the screen to guarantee that the specified designer is visible.

System_CAPS_pubmethodEquals(Object)

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

System_CAPS_protmethodFinalize()

When overridden in a derived class, allows an object to clean up any resources deterministically.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetConnectionPoints(DesignerEdges)

Returns a read-only collection of connection points for the activity designer along the specified DesignerEdges.

System_CAPS_protmethodGetConnections(DesignerEdges)

Returns a read-only collection of points that the designer uses for connections.

System_CAPS_pubmethodGetHashCode()

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

System_CAPS_pubmethodGetPreviewImage(Graphics)

Gets the image of the activity designer on the specified Graphics.

System_CAPS_pubmethodSystem_CAPS_staticGetRootDesigner(IServiceProvider)

Returns the designer associated with the design surface of the workflow.

System_CAPS_protmethodGetService(Type)

Tries to retrieve the specified type of service from the design mode site for the activity associated with the designer.

System_CAPS_pubmethodGetType()

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

System_CAPS_pubmethodHitTest(Point)

Gets information about the ActivityDesigner at a specified point on the screen.

System_CAPS_protmethodInitialize(Activity)

Initializes the designer with the associated Activity.

System_CAPS_pubmethodInvalidate()

Invalidates the designer.

System_CAPS_pubmethodInvalidate(Rectangle)

Invalidates the specified rectangle on the designer.

System_CAPS_pubmethodSystem_CAPS_staticIsCommentedActivity(Activity)

Returns a value that indicates whether the current designer's activity is commented or is inside a commented activity.

System_CAPS_protmethodIsSupportedActivityType(Type)

Returns a value that indicates whether the specified activity type is supported if the activity designer is a root designer.

System_CAPS_protmethodLoadViewState(BinaryReader)

Loads the view state of the designer from a binary stream.

System_CAPS_protmethodMemberwiseClone()

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

System_CAPS_protmethodOnActivityChanged(ActivityChangedEventArgs)

Notifies the ActivityDesigner when the activity it is associated with changes.

System_CAPS_protmethodOnBeginResizing(ActivityDesignerResizeEventArgs)

Notifies the ActivityDesigner when a user starts to visually resize the activity designer when the designer is in a T:System.Workflow.ComponentModel.Design.FreeFormActivityDesigner.

System_CAPS_protmethodOnConnected(ConnectionPoint, ConnectionPoint)

Notifies the ActivityDesigner when a connection is established between two connection points.

System_CAPS_protmethodOnDragDrop(ActivityDragEventArgs)

Occurs when the drag-drop operation is completed inside designer bounds.

System_CAPS_protmethodOnDragEnter(ActivityDragEventArgs)

Occurs when the drag-drop operation is in progress and the pointer enters the designer bounds.

System_CAPS_protmethodOnDragLeave()

Occurs when the drag-drop operation is in progress and the pointer leaves the designer bounds.

System_CAPS_protmethodOnDragOver(ActivityDragEventArgs)

Occurs when the drag-drop operation is in progress and the pointer is within the designer bounds.

System_CAPS_protmethodOnEndResizing()

Notifies the ActivityDesigner when a user is finished visually resizing the activity designer when the designer is in a T:System.Workflow.ComponentModel.Design.FreeFormActivityDesigner.

System_CAPS_protmethodOnExecuteDesignerAction(DesignerAction)

Notifies the ActivityDesigner when the user clicks on the configuration errors associated with the designer.

System_CAPS_protmethodOnGiveFeedback(GiveFeedbackEventArgs)

Updates the visual cues for feedback supplied to the user when performing a drag operation.

System_CAPS_protmethodOnKeyDown(KeyEventArgs)

Occurs when a key is pressed when the designer has the keyboard focus.

System_CAPS_protmethodOnKeyUp(KeyEventArgs)

Occurs when a key is released when the designer has keyboard focus.

System_CAPS_protmethodOnLayoutPosition(ActivityDesignerLayoutEventArgs)

Notifies the ActivityDesigner when a user repositions its visual cues or child activity designers.

System_CAPS_protmethodOnLayoutSize(ActivityDesignerLayoutEventArgs)

Returns the size of the visual cues or child activity designers on the ActivityDesigner.

System_CAPS_protmethodOnMouseCaptureChanged()

Occurs when the mouse capture changes.

System_CAPS_protmethodOnMouseDoubleClick(MouseEventArgs)

Occurs when the mouse button is clicked multiple times on the designer.

System_CAPS_protmethodOnMouseDown(MouseEventArgs)

Occurs when the mouse button is pressed when the pointer is in designer bounds.

System_CAPS_protmethodOnMouseDragBegin(Point, MouseEventArgs)

Occurs when the user starts to drag the mouse on the designer.

System_CAPS_protmethodOnMouseDragEnd()

Occurs when the user stops dragging the mouse on the designer.

System_CAPS_protmethodOnMouseDragMove(MouseEventArgs)

Occurs on each movement of the mouse as the user drags the pointer over the designer.

System_CAPS_protmethodOnMouseEnter(MouseEventArgs)

Occurs when the mouse first enters the designer bounds.

System_CAPS_protmethodOnMouseHover(MouseEventArgs)

Occurs when the pointer is in designer bounds.

System_CAPS_protmethodOnMouseLeave()

Occurs when the pointer leaves designer bounds.

System_CAPS_protmethodOnMouseMove(MouseEventArgs)

Occurs when the pointer is moving in designer bounds.

System_CAPS_protmethodOnMouseUp(MouseEventArgs)

Occurs when the mouse button is released when the pointer is in designer bounds.

System_CAPS_protmethodOnPaint(ActivityDesignerPaintEventArgs)

Draws the visual representation of the activity at design time.

System_CAPS_protmethodOnProcessMessage(Message)

Allows the designer to process raw Win32 messages.

System_CAPS_protmethodOnQueryContinueDrag(QueryContinueDragEventArgs)

Controls whether the drag operation should continue.

System_CAPS_protmethodOnResizing(ActivityDesignerResizeEventArgs)

Notifies 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 T:System.Workflow.ComponentModel.Design.FreeFormActivityDesigner.

System_CAPS_protmethodOnScroll(ScrollBar, Int32)

Notifies the ActivityDesigner when a user changes the scroll position.

System_CAPS_protmethodOnShowSmartTagVerbs(Point)

Displays the designer verbs associated with a smart tag at the specified point.

System_CAPS_protmethodOnSmartTagVisibilityChanged(Boolean)

Notifies the ActivityDesigner whether a smart tag should be displayed or hidden.

System_CAPS_protmethodOnThemeChange(ActivityDesignerTheme)

Notifies the designer that the associated theme has changed.

System_CAPS_protmethodPerformLayout()

Updates the layout of the designer.

System_CAPS_protmethodPointToLogical(Point)

Transforms a point from screen coordinate system to the activity designer coordinate system.

System_CAPS_protmethodPointToScreen(Point)

Transforms a point from the activity designer coordinate system to the screen coordinate system.

System_CAPS_protmethodPostFilterAttributes(IDictionary)

When overridden in a derived class, allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.

System_CAPS_protmethodPostFilterEvents(IDictionary)

When overridden in a derived class, allows the designer to change or remove items from the set of events that it exposes through a TypeDescriptor.

System_CAPS_protmethodPostFilterProperties(IDictionary)

When overridden in a derived class, allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.

System_CAPS_protmethodPreFilterAttributes(IDictionary)

When overridden in a derived class, allows a designer to add items to the set of attributes that it exposes through a TypeDescriptor.

System_CAPS_protmethodPreFilterEvents(IDictionary)

When overridden in a derived class, allows a designer to add items to the set of events that it exposes through a TypeDescriptor.

System_CAPS_protmethodPreFilterProperties(IDictionary)

When overridden in a derived class, allows a designer to add items to the set of properties that it exposes through a TypeDescriptor.

System_CAPS_protmethodRectangleToLogical(Rectangle)

Transforms a rectangle from the screen coordinate system to the activity designer coordinate system.

System_CAPS_protmethodRectangleToScreen(Rectangle)

Transforms a rectangle from the activity designer coordinate system to the screen coordinate system.

System_CAPS_protmethodRefreshDesignerActions()

Refreshes the configuration errors associated with the designer.

System_CAPS_protmethodRefreshDesignerVerbs()

Refreshes the activity designer verbs associated with the designer by calling the status handler.

System_CAPS_protmethodSaveViewState(BinaryWriter)

Stores the view state of the designer into a binary stream.

System_CAPS_protmethodShowInfoTip(String)

Shows the specified info tip.

System_CAPS_protmethodShowInfoTip(String, String)

Displays the info tip for the ActivityDesigner with the specified title and text.

System_CAPS_protmethodShowInPlaceTip(String, Rectangle)

Displays the specified tool tip in the specified rectangle location.

System_CAPS_pubmethodToString()

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

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesigner.DoDefaultAction()

Performs the default action associated with the designer.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesigner.Initialize(IComponent)

Initializes the designer with the associated activity.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PostFilterAttributes(IDictionary)

When overridden in a derived class, allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PostFilterEvents(IDictionary)

When overridden in a derived class, allows a designer to change or remove items from the set of events that it exposes through a TypeDescriptor.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PostFilterProperties(IDictionary)

When overridden in a derived class, allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PreFilterAttributes(IDictionary)

When overridden in a derived class, allows a designer to add items to the set of attributes that it exposes through a TypeDescriptor.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PreFilterEvents(IDictionary)

When overridden in a derived class, allows a designer to add items to the set of events that it exposes through a TypeDescriptor.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDesignerFilter.PreFilterProperties(IDictionary)

When overridden in a derived class, allows a designer to add items to the set of properties that it exposes through a TypeDescriptor.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRootDesigner.GetView(ViewTechnology)

Returns a view object for the specified view technology.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIToolboxUser.GetToolSupported(ToolboxItem)

Determines whether the specified Toolbox item is supported by the current activity designer.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIToolboxUser.ToolPicked(ToolboxItem)

Selects the specified toolbox item.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIPersistUIState.LoadViewState(BinaryReader)

Restores the view state from a binary stream.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIPersistUIState.SaveViewState(BinaryWriter)

Saves the view state to a binary stream.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIWorkflowRootDesigner.IsSupportedActivityType(Type)

Returns a value that indicates whether the specified type is supported on the current ActivityDesigner.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIDesigner.Component

Gets the base component with which the activity designer is associated.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIDesigner.Verbs

Gets the design-time verbs associated with the activity designer.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIRootDesigner.SupportedTechnologies

Gets the array of technologies that the activity designer can support for its display.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIWorkflowRootDesigner.InvokingDesigner

Gets or sets the CompositeActivityDesigner that requested the activity designer be initialized.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIWorkflowRootDesigner.MessageFilters

Gets any message filters associated with the activity designer.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIWorkflowRootDesigner.SupportsLayoutPersistence

Gets the value that indicates whether the actual workflow root designer supports the layout persistence.

System_CAPS_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
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:
© 2016 Microsoft