WorkflowTheme.CurrentTheme Proprietà

Definizione

Ottiene o imposta il tema corrente.

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

Valore della proprietà

Oggetto WorkflowTheme che viene utilizzato per le impostazioni di visualizzazione.

Esempio

Nell'esempio di codice seguente viene illustrato come utilizzare la proprietà CurrentTheme per accedere all'oggetto AmbientTheme associato a un flusso di lavoro.

Questo esempio di codice è parte dell'esempio SDK Workflow Monitor nel file DesignerGlyphProvider.cs. Per altre informazioni, vedere Monitoraggio del flusso di lavoro.

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

Commenti

Utilizzare CurrentTheme per apportare modifiche al tema utilizzato per visualizzare il flusso di lavoro.

Si applica a

Vedi anche