DesignerGlyph.GetBounds Method
Returns the bounds for the glyph on the specified ActivityDesigner.
Assembly: System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)
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.
| Exception | Condition |
|---|---|
| ArgumentNullException | designer contains a null reference (Nothing in Visual Basic). |
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; }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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.