แก้ไข

แชร์ผ่าน


AmbientTheme.GlyphSize Property

Definition

Gets the ambient height and width of glyphs on the workflow design surface.

public:
 virtual property System::Drawing::Size GlyphSize { System::Drawing::Size get(); };
[System.ComponentModel.Browsable(false)]
public virtual System.Drawing.Size GlyphSize { get; }
[<System.ComponentModel.Browsable(false)>]
member this.GlyphSize : System.Drawing.Size
Public Overridable ReadOnly Property GlyphSize As Size

Property Value

A Size value that represents the ambient height and width of glyphs on the workflow design surface.

Attributes

Examples

The following code example demonstrates a common way you can access the GlyphSize property from a class that derives from the DesignerGlyph class.

This code example is part of the Workflow Monitor SDK Sample from the DatabaseService.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;
}
Public Overrides Function GetBounds(ByVal designer As System.Workflow.ComponentModel.Design.ActivityDesigner, ByVal activated As Boolean) As System.Drawing.Rectangle
    Dim imageBounds As Rectangle = Rectangle.Empty
    Dim image As Image = AppResources.Executing
    If Not image Is Nothing Then
        Dim glyphSize As Size = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize
        imageBounds.Location = New Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2)
        imageBounds.Size = glyphSize
    End If
    Return imageBounds
End Function

Applies to

See also