Bagikan melalui


WorkflowTheme.CurrentTheme Properti

Definisi

Mendapatkan atau mengatur tema saat ini.

public:
 static property System::Workflow::ComponentModel::Design::WorkflowTheme ^ CurrentTheme { System::Workflow::ComponentModel::Design::WorkflowTheme ^ get(); void set(System::Workflow::ComponentModel::Design::WorkflowTheme ^ value); };
public static System.Workflow.ComponentModel.Design.WorkflowTheme CurrentTheme { get; set; }
static member CurrentTheme : System.Workflow.ComponentModel.Design.WorkflowTheme with get, set
Public Shared Property CurrentTheme As WorkflowTheme

Nilai Properti

Yang WorkflowTheme digunakan untuk pengaturan tampilan.

Contoh

Contoh kode berikut menunjukkan cara menggunakan CurrentTheme properti untuk mengakses AmbientTheme yang terkait dengan alur kerja.

Contoh kode ini adalah bagian dari Sampel SDK Monitor Alur Kerja dari file DesignerGlyphProvider.cs. Untuk informasi selengkapnya, lihat Pemantauan Alur Kerja.

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

Keterangan

Gunakan CurrentTheme untuk membuat perubahan pada tema yang digunakan untuk menampilkan alur kerja.

Berlaku untuk

Lihat juga