Share via


AmbientTheme.GlyphSize 属性

定义

获取工作流设计图面上标志符号的环境高度和宽度。

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

属性值

表示工作流设计图面上标志符号的环境高度和宽度的 Size 值。

属性

示例

下面的代码示例演示一种可从派生自 GlyphSize 类的类访问 DesignerGlyph 属性的通用方法。

此代码示例摘自 DatabaseService.cs 文件中的“工作流监控”SDK 示例。 有关详细信息,请参阅 工作流监视器

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

适用于

另请参阅