AmbientTheme.GlyphSize 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定工作流程設計介面上的環境圖像 (Glyph) 高度和寬度。
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