Freigeben über


DesignSurfaceElementOperations Class

Definition

Extends the IMS ElementOperations class by adding support for GhostShapeCollections.

public ref class DesignSurfaceElementOperations : Microsoft::VisualStudio::Modeling::ElementOperations
public class DesignSurfaceElementOperations : Microsoft.VisualStudio.Modeling.ElementOperations
type DesignSurfaceElementOperations = class
    inherit ElementOperations
Public Class DesignSurfaceElementOperations
Inherits ElementOperations
Inheritance
DesignSurfaceElementOperations

Remarks

Derive from this class to create custom data formats for copy and paste operations.

Constructors

DesignSurfaceElementOperations(IServiceProvider, Diagram)

Initializes a new instance of the DesignSurfaceElementOperations class for a specific diagram The model partition is assumed to be that of the model element the diagram is viewing.

DesignSurfaceElementOperations(IServiceProvider, Partition, Diagram)

Initializes a new instance of the DesignSurfaceElementOperations class.

DesignSurfaceElementOperations(IServiceProvider, Partition)

Initializes a new instance of the DesignSurfaceElementOperations class. Note that since no Diagram is specified, multiple diagrams will not be supported and any merged PELs will end up in the default diagram (the first created diagram viewing the model)

Fields

TargetDiagramIdContextKey

Key of the element Id of the diagram in the TargetConext of merged ElementGroupPrototypes

Properties

Diagram

The diagram owning this DesignSurfaceElementOperations (i.e. the diagram to which the operations are expected to apply)

Partition

The partition that the ModelElements belong to.

(Inherited from ElementOperations)
ServiceProvider

Gets the IServiceProvider.

(Inherited from ElementOperations)
Store

Gets the store that the ModelElements belong to.

(Inherited from ElementOperations)

Methods

AddCustomFormat(IDataObject, ICollection<ModelElement>, ClosureType, PointF)

Adds one or more custom data formats to the specified IDataObject using the specified collection of ModelElements.

(Inherited from ElementOperations)
AddElementGroupFormat(IDataObject, ICollection<ModelElement>, ClosureType, Boolean)

Adds the ElementGroupPrototype format to the specified IDataObject using the specified collection of ModelElements. Can be called from derived classes to force demand load of element links in order to create the collection of model elements.

(Inherited from ElementOperations)
AddElementGroupFormat(IDataObject, ICollection<ModelElement>, ClosureType)

Adds the ElementGroupPrototype format to the specified IDataObject using the specified collection of ModelElements. This method calls the following 3 overridable methods(in order) a. CreateElementGroup b. MarkRootElements c. CreateElementGroupPrototype It then stashes the created ElementGroupPrototype in the data parameter.

(Inherited from ElementOperations)
AddGhostShapesContext(IDataObject, Diagram, PointD)

Adds a GhostShapeCollection to the ElementGroupPrototype in the specified IDataObject.

CanAddCustomFormat(ICollection<ModelElement>, ClosureType)

Returns a value indicating whether the ModelElement collection can be used to create a custom format.

(Inherited from ElementOperations)
CanAddElementGroupFormat(ICollection<ModelElement>, ClosureType)

Returns a value indicating whether the ModelElement collection can be used to create an ElementGroupPrototype format.

(Inherited from ElementOperations)
CanCopy(ICollection<ModelElement>, ClosureType)

Gets a value indicating whether the collection of ModelElements can be copied to an IDataObject. Calls CanCopyCore to do the work.

(Inherited from ElementOperations)
CanCopy(ICollection<ModelElement>)

Gets a value indicating whether the collection of ModelElements can be copied to an IDataObject.

(Inherited from ElementOperations)
CanCopyCore(ICollection<ModelElement>, ClosureType)

Gets a value indicating whether the collection of ModelElements can be copied to an IDataObject. This is implemented outside of CanCopy, so that subclasses can override the public CanCopy and CanMove methods independently. If subclasses want to have the same behavior for both CanCopy and CanMove, they can just override this method. (Before this method existed, overriding only CanCopy led to the side effect of changing the CanMove behavior.)

(Inherited from ElementOperations)
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.

(Inherited from ElementOperations)
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.

(Inherited from ElementOperations)
CanMerge(ModelElement, IDataObject)

Returns a value indicating whether the ElementGroupPrototype from the IDataObject can be merged (i.e., pasted or dropped) into the target ModelElement.

(Inherited from ElementOperations)
CanMergeElementGroupPrototype(ModelElement, ElementGroupPrototype)
CanMergeElementGroupPrototype(ModelElement, ProtoElementBase, ElementGroupPrototype)
CanMove(ICollection<ModelElement>)

Gets a value indicating whether the collection of ModelElements can be moved.

(Inherited from ElementOperations)
ChooseMergeTarget(ModelElement, ElementGroup)

Gets the target element for the merge, given the proposed targetElement. This gives the ElementOperations the chance to change the intended target for the merge. By default, this method will give the target element the chance to change the intended target.

ChooseMergeTarget(ModelElement, ElementGroupPrototype)

Gets the target element for the merge, given the proposed targetElement. This gives the ElementOperations the chance to change the intended target for the merge. By default, this method will give the target element the chance to change the intended target.

Copy(IDataObject, ICollection<ModelElement>, ClosureType, PointF)

Copies the collection of ModelElements to the specified IDataObject in one or more data formats.

(Inherited from ElementOperations)
Copy(IDataObject, ICollection<ModelElement>, ClosureType)

Copies the collection of ModelElements to the specified IDataObject in one or more data formats.

(Inherited from ElementOperations)
Copy(IDataObject, ICollection<ModelElement>, PointF)

Copies the collection of ModelElements to the specified IDataObject in one or more data formats.

(Inherited from ElementOperations)
Copy(IDataObject, ICollection<ModelElement>)

Copies the collection of ModelElements to the specified IDataObject in one or more data formats.

(Inherited from ElementOperations)
CreateElementGroup(ICollection<ModelElement>, ClosureType)

Creates a ClosureElementGroup

(Inherited from ElementOperations)
CreateElementGroupPrototype(ElementGroup, ICollection<ModelElement>, ClosureType) (Inherited from ElementOperations)
GetAssociatedModelElement(ElementGroupPrototype, ProtoElementBase)

Gets the ProtoElement associated with the specified protoPresentationElement via the PresentationViewsSubject relationship.

GetTargetDiagramId(ElementGroupPrototype)

Get the Id of the Diagram targetted by an ElementGroupPrototype Merge/CanMerge originating from an instance of this class.

MarkRootElements(ElementGroup, ICollection<ModelElement>, ClosureType)

Mark RootElements in the elementGroup parameter This default implementation does not take the elements and closureType parameters into account. All groupElements in the elementGroup object, that are not the target of any group-contained, embedding relationship are marked as root.

(Inherited from ElementOperations)
Merge(ModelElement, IDataObject)

Merges (i.e., pastes or drops) the ElementGroupPrototype from the IDataObject to the target ModelElement.

(Inherited from ElementOperations)
Merge(PresentationElement, IDataObject, PointF)

Merges (i.e., pastes or drops) the ElementGroupPrototype from the IDataObject to the target ModelElement.

MergeElementGroup(ModelElement, ElementGroup)

Merges the source ElementGroup with the specified target ModelElement. This method is intended for use when an ElementGroupPrototype is not available, that is, when a collection of actual ModelElements should be merged. If an ElementGroupPrototype is available (e.g., clipboard scenarios), call MergeElementGroupProtoype instead. This method performs the following: (1) calls the target element's MergeRelate virtual method for each root element in the group to provide the target with the opportunity to connect a root element to itself, (2) calls the virtual method MergeConfigure on the root element immediately after calling MergeRelate to provide the root element with an opportunity to configure itself, and (3) calls OnMerged to provide any ElementOperations-derived class the opportunity to plug in custom processing.

(Inherited from ElementOperations)
MergeElementGroupPrototype(ModelElement, ElementGroupPrototype, PointF)

Merges the source ElementGroupPrototype with the specified target ModelElement.

MergeElementGroupPrototype(ModelElement, ElementGroupPrototype)
OnElementsReconstituted(MergeElementGroupEventArgs)

Called by MergeElementGroupPrototype immediately after the elements from the ElementGroupPrototype have been reconstituted, but before they are connected to the rest of the model.

(Inherited from ElementOperations)
OnMerged(MergeElementGroupEventArgs)

Called by MergeElementGroupPrototype immediately before the local transaction is committed. The rules are queued during the local transaction and fired when the transaction commits. The local transaction wraps reconstituting and connecting elements.

This method raises the custom model event ShapeElementViewFixupEvent for every root protoElement PEL that doesn't have a corresponding protoElement MEL. The rule processing of this event connects the PEL to the diagram if it isn't already.

OnMerging(MergeElementGroupEventArgs)

Called by MergeElementGroupPrototype immediately after the target element has been chosen, but before the elements from the ElementGroupPrototype have been reconstituted.

(Inherited from ElementOperations)
PropagateElementGroupContextToTransaction(ModelElement, ElementGroup, Transaction)

Events

ElementsReconstituted

Called by MergeElementGroupPrototype immediately after the elements from the ElementGroupPrototype have been reconstituted, but before they are connected to the rest of the model.

(Inherited from ElementOperations)
Merged

Called by MergeElementGroupPrototype immediately before the local transaction is committed. The rules are queued during the local transaction and fired when the transaction commits. The local transaction wraps reconstituting and connecting elements.

(Inherited from ElementOperations)
Merging

Called by MergeElementGroupPrototype immediately after the target element has been chosen, but before the elements from the ElementGroupPrototype have been reconstituted.

(Inherited from ElementOperations)

Applies to