ElementOperations.CanDelete Method

Definition

Overloads

CanDelete(ModelElement, Guid[])

Query whether a specified element can be deleted, taking into account any IMS locks applicable to any of the elements in the delete closure of the element. An element cannot be deleted if any element in the closure is Delete locked, or if any element is the target of a link sourced on an element with the RolePlayer lock AND that element is outside the closure.

CanDelete(IEnumerable<ModelElement>, Guid[])

Query whether a specified set of elements can be deleted, taking into account any IMS locks applicable to any of the elements in the complete delete closure of the elements. The elements cannot be deleted if any element in the closure is Delete locked, or if any element is the target of a link sourced on an element with the RolePlayer lock AND that element is outside the closure.

CanDelete(ModelElement, Guid[])

Query whether a specified element can be deleted, taking into account any IMS locks applicable to any of the elements in the delete closure of the element. An element cannot be deleted if any element in the closure is Delete locked, or if any element is the target of a link sourced on an element with the RolePlayer lock AND that element is outside the closure.

C++
public:
 virtual bool CanDelete(Microsoft::VisualStudio::Modeling::ModelElement ^ element, ... cli::array <Guid> ^ domainRolesToNotPropagate);

Parameters

element
ModelElement

Candidate ModelElement for deletion

domainRolesToNotPropagate
Guid[]

A list of domain role ID-s through which delete should not be propagated.

Returns

true if the element can be deleted, false if not

Applies to

Visual Studio SDK 2022 an aner Versiounen
Produkt Versiounen
Visual Studio SDK 2017, 2019, 2022

CanDelete(IEnumerable<ModelElement>, Guid[])

Query whether a specified set of elements can be deleted, taking into account any IMS locks applicable to any of the elements in the complete delete closure of the elements. The elements cannot be deleted if any element in the closure is Delete locked, or if any element is the target of a link sourced on an element with the RolePlayer lock AND that element is outside the closure.

C++
public:
 virtual bool CanDelete(System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::Modeling::ModelElement ^> ^ elements, ... cli::array <Guid> ^ domainRolesToNotPropagate);

Parameters

elements
IEnumerable<ModelElement>

Candidate ModelElements for deletion

domainRolesToNotPropagate
Guid[]

A list of domain role ID-s through which delete should not be propagated.

Returns

true if the all the elements can be deleted, false if any cannot OR the collection is empty

Applies to

Visual Studio SDK 2022 an aner Versiounen
Produkt Versiounen
Visual Studio SDK 2017, 2019, 2022