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를 부모로 사용할 수 있는지 여부를 테스트하는 데 유용합니다.

이 메서드는 사용자가 끌어서 놓기 또는 붙여넣기와 같은 삽입 작업을 초기화할 때 호출됩니다.

적용 대상