Export (0) Print
Expand All

DesignerGlyph.OnPaint Method

When overridden in a derived class, performs any tasks required to render the glyph on the activity designer surface.

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

protected abstract void OnPaint(
	Graphics graphics,
	bool activated,
	AmbientTheme ambientTheme,
	ActivityDesigner designer
)

Parameters

graphics
Type: System.Drawing.Graphics

The Graphics to perform fill and drawing tasks.

activated
Type: System.Boolean

true to indicate that the glyph appears on the design surface; otherwise, false.

ambientTheme
Type: System.Workflow.ComponentModel.Design.AmbientTheme

The AmbientTheme to use to access ambient property settings.

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

The ActivityDesigner from which to obtain information about user actions.

OnPaint uses CommentIndicatorPen to draw the bounds of the comment glyph and CommentIndicatorBrush to fill it.

The following code example demonstrates how you can override the OnPaint method. The code customizes how to draw the glyph object on the activity designer with which the glyph is associated.

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

protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
{
    Bitmap bitmap = Resources.Executing;
    bitmap.MakeTransparent(Color.FromArgb(0, 255, 255));
    if (bitmap != null)
        graphics.DrawImage(bitmap, GetBounds(designer, activated), new Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel);
}

.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