ActivityDesigner.CanBeParentedTo(CompositeActivityDesigner) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value that indicates if a CompositeActivity can be set as the parent of the activity associated with the designer.
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
The CompositeActivityDesigner which can potentially be set as parent.
true
if a CompositeActivity can be set as the parent of the activity associated with the designer; otherwise, false
.
The following example demonstrates how to ensure that a custom activity is parented to specific activity types. In this case, the custom activity can only be parented to a 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
This method is useful for testing whether a designer can be parented by a particular CompositeActivityDesigner.
This method is called when a user initiates an insertion operation, such as drag-and-drop or paste.
מוצר | גירסאות |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
משוב של .NET
.NET הוא פרויקט קוד פתוח. בחר קישור כדי לספק משוב: