ParentAdapter.CanParent Method
Gets a value indicating whether the specified parent object can be a parent to an object of the specified type.
Namespace: Microsoft.Windows.Design.Interaction
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public Overridable Function CanParent ( _
parent As ModelItem, _
childType As Type _
) As Boolean
public virtual bool CanParent(
ModelItem parent,
Type childType
)
public:
virtual bool CanParent(
ModelItem^ parent,
Type^ childType
)
abstract CanParent :
parent:ModelItem *
childType:Type -> bool
override CanParent :
parent:ModelItem *
childType:Type -> bool
public function CanParent(
parent : ModelItem,
childType : Type
) : boolean
Parameters
- parent
Type: Microsoft.Windows.Design.Model.ModelItem
A ModelItem representing the parent.
- childType
Type: System.Type
The type of child item.
Return Value
Type: System.Boolean
true if the specified parent can accept a child of the specified type; otherwise, false. The default is true.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | parent or childType is nulla null reference (Nothing in Visual Basic). |
Remarks
Use CanParent for drag operations of live objects on the design surface and for drag operations of items from the Toolbox.
The default implementation returns true, which indicates that the parent supports all children.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design.Interaction Namespace