Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DesignerGlyph Class

Note: This API is now obsolete.

Draws a glyph at the top-most Z order position on an activity designer.

Namespace:  System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)
[ObsoleteAttribute("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public abstract class DesignerGlyph

The DesignerGlyph type exposes the following members.

  NameDescription
Protected methodDesignerGlyphWhen implemented in a derived class, initializes a new instance of the DesignerGlyph class.
Top
  NameDescription
Public propertyCanBeActivatedGets a value indicating whether the DesignerGlyph can gain focus on the ActivityDesigner with which it is associated.
Public propertyPriorityGets the priority setting for the designer glyph on the activity design surface.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBoundsReturns the bounds for the glyph on the specified ActivityDesigner.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnActivateIndicates to the glyph that an action has been performed which has activated the glyph.
Protected methodOnPaintWhen overridden in a derived class, performs any tasks required to render the glyph on the activity designer surface.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public fieldStatic memberHighestPriorityRepresents the highest priority possible for a DesignerGlyph. This value is a constant.
Public fieldStatic memberLowestPriorityRepresents the lowest priority possible for a DesignerGlyph. This value is a constant.
Public fieldStatic memberNormalPriorityRepresents the normal priority for a DesignerGlyph. This value is a constant.
Top
NoteNote

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

The DesignerGlyph class is the base class for all designer glyphs used on a workflow design surface.

Activity designer developers can use classes that inherit from DesignerGlyph to draw custom glyphs onto the surface of an ActivityDesigner. DesignerGlyph classes draw such glyphs at the top-level Z order, which places the custom glyph visually on top of all other glyphs on the designer based on the Priority value of the custom glyph. A lower value for the Priority property indicates a higher priority and therefore draws the glyph at the top-most Z order position on an activity designer.

Notes to Inheritors

When you inherit from DesignerGlyph, you must override the following members: OnPaint.

The following code example demonstrates a glyph class that derives from the DesignerGlyph class. The code overrides the GetBounds and OnPaint methods.

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

//Define a glyph to show an activity is executing, i.e. not 'closed' 
internal sealed class ExecutingGlyph : DesignerGlyph
{
    internal ExecutingGlyph()
    {
    }

    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;
    }

    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, 3.5, 3.0
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5

Windows Phone 8.1, Windows Phone 8, 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.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.