ActivityDesigner.CanBeParentedTo(CompositeActivityDesigner) メソッド

定義

CompositeActivity を、デザイナーに関連付けられたアクティビティの親として設定できるかどうかを示す値を返します。

public:
 virtual bool CanBeParentedTo(System::Workflow::ComponentModel::Design::CompositeActivityDesigner ^ parentActivityDesigner);
public virtual bool CanBeParentedTo (System.Workflow.ComponentModel.Design.CompositeActivityDesigner parentActivityDesigner);
abstract member CanBeParentedTo : System.Workflow.ComponentModel.Design.CompositeActivityDesigner -> bool
override this.CanBeParentedTo : System.Workflow.ComponentModel.Design.CompositeActivityDesigner -> bool
Public Overridable Function CanBeParentedTo (parentActivityDesigner As CompositeActivityDesigner) As Boolean

パラメーター

parentActivityDesigner
CompositeActivityDesigner

親として設定できる可能性のある CompositeActivityDesigner

戻り値

CompositeActivity をデザイナーに関連付けられたアクティビティの親として設定できる場合は true。それ以外の場合は false

特定のアクティビティ タイプがカスタム アクティビティの親になれることを確認する方法の例を、次に示します。 この場合、カスタム アクティビティの親になれるのは、ParallelIfActivity のみです。

public override bool CanBeParentedTo(CompositeActivityDesigner parentActivityDesigner)
{
    if (null == parentActivityDesigner)
        throw new ArgumentNullException("parentActivityDesigner");

    if (!(parentActivityDesigner.Activity is ParallelIfActivity))
        return false;
    else
        return base.CanBeParentedTo(parentActivityDesigner);
}
Public Overrides Function CanBeParentedTo(ByVal parentActivityDesigner As CompositeActivityDesigner) As Boolean
    If parentActivityDesigner Is Nothing Then
        Throw New ArgumentNullException("parentActivityDesigner")
    End If

    If Not TypeOf parentActivityDesigner.Activity Is ParallelIfActivity Then
        Return False
    Else
        Return MyBase.CanBeParentedTo(parentActivityDesigner)
    End If
End Function

注釈

このメソッドは、特定の CompositeActivityDesigner がデザイナーの親になれるかどうかをテストする場合に役立ちます。

このメソッドは、ユーザーがドラッグ アンド ドロップや貼り付けなどの挿入操作を開始したときに呼び出されます。

適用対象