CompositeActivityDesigner.Expanded CompositeActivityDesigner.Expanded CompositeActivityDesigner.Expanded CompositeActivityDesigner.Expanded Property

Definition

Ruft einen Wert ab oder legt einen Wert fest, der angibt, ob CompositeActivityDesigner erweitert werden soll.Gets or sets a value that indicates whether the CompositeActivityDesigner is expanded.

public:
 virtual property bool Expanded { bool get(); void set(bool value); };
public virtual bool Expanded { get; set; }
member this.Expanded : bool with get, set
Public Overridable Property Expanded As Boolean

Eigenschaftswert

true, wenn CompositeActivityDesigner erweitert ist, andernfalls false.true if the CompositeActivityDesigner is expanded; otherwise false.

Beispiele

Folgendes Codebeispiel zeigt, wie Sie die Expanded-Eigenschaft basierend auf einem als Argument an eine Methode übergebenen Boolean-Wert festlegen können.The following code example demonstrates how you can set the Expanded property based on a Boolean value passed as an argument to a method.

Dieses Codebeispiel stammt aus dem Workflow Monitor SDK-Beispiel (ViewHost.cs).This code example is part of the Workflow Monitor SDK sample from the ViewHost.cs file. Weitere Informationen finden Sie unter Workflow Monitor.For more information, see Workflow Monitor.

internal void Expand(bool expand)
{
    IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost;
    if (host == null)
        return;

    this.SuspendLayout();

    CompositeActivity root = host.RootComponent as CompositeActivity;
    foreach (Activity activity in root.Activities)
    {
        CompositeActivityDesigner compositeActivityDesigner = host.GetDesigner((IComponent)activity) as CompositeActivityDesigner;
        if (compositeActivityDesigner != null)
        {
            compositeActivityDesigner.Expanded = expand;
        }
    }

    this.ResumeLayout(true);
}
Friend Sub Expand(ByVal expand As Boolean)
    Dim host As IDesignerHost = GetService(GetType(IDesignerHost))
    If host Is Nothing Then
        Return
    End If

    Me.SuspendLayout()

    Dim root As CompositeActivity = host.RootComponent
    Dim activity As Activity
    For Each activity In root.Activities
        Dim compositeActivityDesigner As CompositeActivityDesigner = host.GetDesigner(CType(activity, IComponent))
        If compositeActivityDesigner IsNot Nothing Then
            compositeActivityDesigner.Expanded = expand
        End If
    Next

    Me.ResumeLayout(True)
End Sub

Hinweise

Verwenden Sie OnMouseDown in Kombination mit ExpandButtonRectangle und Expanded, um die entsprechende Aktion zu ermitteln, wenn ein Benutzer auf CompositeActivityDesigner auf die Schaltfläche Erweitern oder Reduzieren klickt.In combination with OnMouseDown and ExpandButtonRectangle, use Expanded to determine the proper action when a user clicks the expand or collapse button on the CompositeActivityDesigner.

Gilt für:

Siehe auch