CompositeActivityDesigner.Expanded プロパティ

定義

CompositeActivityDesigner が展開されているかどうかを示す値を取得または設定します。

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

プロパティ値

CompositeActivityDesigner が展開されている場合は true。それ以外の場合は false

引数としてメソッドに渡される Expanded 値に基づいて Boolean プロパティを設定する方法を、次のコード例に示します。

このコード例は、ViewHost.cs ファイルから抜粋したワークフロー モニターの SDK サンプルの一部です。 詳細については、「 ワークフロー モニター」を参照してください。

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

注釈

OnMouseDown 上の展開または折りたたみボタンをユーザーがクリックしたときに適切なアクションを判断するには、ExpandButtonRectangle を、Expanded および CompositeActivityDesigner と組み合わせて使用します。

適用対象

こちらもご覧ください