Export (0) Print
Expand All

DesignerGlyph.GetBounds Method

Returns the bounds for the glyph on the specified ActivityDesigner.

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

public virtual Rectangle GetBounds(
	ActivityDesigner designer,
	bool activated
)

Parameters

designer
Type: System.Workflow.ComponentModel.Design.ActivityDesigner

The ActivityDesigner with which the glyph is associated.

activated
Type: System.Boolean

true to indicate whether the glyph appears on the activity designer surface; otherwise, false.

Return Value

Type: System.Drawing.Rectangle
A Rectangle that represents the bounds for the glyph.

ExceptionCondition
ArgumentNullException

designer contains a null reference (Nothing in Visual Basic).

Unless overridden in a derived class, GetBounds returns the bounds of the activity designer with which the glyph is associated.

The following code example demonstrates how you can override the GetBounds method. The code sets the size and location of the custom glyph object.

This code example is part of the Workflow Monitor SDK Sample from the DesignerGlyphProvider.cs file. For more information, see Workflow Monitor.

public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
{
    Rectangle imageBounds = Rectangle.Empty;
    Image image = Resources.Executing;
    if (image != null)
    {
        Size glyphSize = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize;
        imageBounds.Location = new Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2);
        imageBounds.Size = glyphSize;
    }
    return imageBounds;
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 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