Partager via


DesignSurfaceElementOperations Class

Extends the IMS ElementOperations class by adding support for GhostShapeCollections.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.ElementOperations
    Microsoft.VisualStudio.Modeling.Diagrams.DesignSurfaceElementOperations

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)

Syntax

'Déclaration
Public Class DesignSurfaceElementOperations _
    Inherits ElementOperations
public class DesignSurfaceElementOperations : ElementOperations
public ref class DesignSurfaceElementOperations : public ElementOperations
type DesignSurfaceElementOperations =  
    class
        inherit ElementOperations
    end
public class DesignSurfaceElementOperations extends ElementOperations

The DesignSurfaceElementOperations type exposes the following members.

Constructors

  Name Description
Public method 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.
Public method 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)
Public method DesignSurfaceElementOperations(IServiceProvider, Partition, Diagram) Initializes a new instance of the DesignSurfaceElementOperations class.

Top

Properties

  Name Description
Protected property Diagram
Protected property Partition (Inherited from ElementOperations.)
Protected property ServiceProvider (Inherited from ElementOperations.)
Protected property Store (Inherited from ElementOperations.)

Top

Methods

  Name Description
Protected method AddCustomFormat Adds one or more custom data formats to the specified IDataObject using the specified collection of ModelElements. (Inherited from ElementOperations.)
Protected method 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.)
Protected method 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.)
Public methodStatic member AddGhostShapesContext Adds a GhostShapeCollection to the ElementGroupPrototype in the specified IDataObject.
Protected method CanAddCustomFormat Returns a value indicating whether the ModelElement collection can be used to create a custom format. (Inherited from ElementOperations.)
Protected method CanAddElementGroupFormat Returns a value indicating whether the ModelElement collection can be used to create an ElementGroupPrototype format. (Inherited from ElementOperations.)
Public method CanCopy(ICollection<ModelElement>) Gets a value indicating whether the collection of ModelElements can be copied to an IDataObject. (Inherited from ElementOperations.)
Public method 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.)
Protected method CanCopyCore Gets a value indicating whether the collection of ModelElements can be copied to an IDataObject. (Inherited from ElementOperations.)
Public method CanDelete(ModelElement, array<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. (Inherited from ElementOperations.)
Public method CanDelete(IEnumerable<ModelElement>, array<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. (Inherited from ElementOperations.)
Public method CanMerge 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.)
Public method CanMergeElementGroupPrototype(ModelElement, ElementGroupPrototype) (Overrides ElementOperations.CanMergeElementGroupPrototype(ModelElement, ElementGroupPrototype).)
Protected method CanMergeElementGroupPrototype(ModelElement, ProtoElementBase, ElementGroupPrototype) (Overrides ElementOperations.CanMergeElementGroupPrototype(ModelElement, ProtoElementBase, ElementGroupPrototype).)
Public method CanMove Gets a value indicating whether the collection of ModelElements can be moved. (Inherited from ElementOperations.)
Public method 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. (Overrides ElementOperations.ChooseMergeTarget(ModelElement, ElementGroup).)
Public method 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. (Overrides ElementOperations.ChooseMergeTarget(ModelElement, ElementGroupPrototype).)
Public method Copy(IDataObject, ICollection<ModelElement>) Copies the collection of ModelElements to the specified IDataObject in one or more data formats. (Inherited from ElementOperations.)
Public method Copy(IDataObject, ICollection<ModelElement>, ClosureType) Copies the collection of ModelElements to the specified IDataObject in one or more data formats. (Inherited from ElementOperations.)
Public method Copy(IDataObject, ICollection<ModelElement>, PointF) Copies the collection of ModelElements to the specified IDataObject in one or more data formats. (Inherited from ElementOperations.)
Public method Copy(IDataObject, ICollection<ModelElement>, ClosureType, PointF) Copies the collection of ModelElements to the specified IDataObject in one or more data formats. (Inherited from ElementOperations.)
Protected method CreateElementGroup Creates a ClosureElementGroup (Inherited from ElementOperations.)
Protected method CreateElementGroupPrototype (Inherited from ElementOperations.)
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic member GetAssociatedModelElement Gets the ProtoElement associated with the specified protoPresentationElement via the PresentationViewsSubject relationship.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodStatic member GetTargetDiagramId Get the Id of the Diagram targetted by an ElementGroupPrototype Merge/CanMerge originating from an instance of this class.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MarkRootElements Mark RootElements in the elementGroup parameter. (Inherited from ElementOperations.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Merge(ModelElement, IDataObject) Merges (i.e., pastes or drops) the ElementGroupPrototype from the IDataObject to the target ModelElement. (Inherited from ElementOperations.)
Public method Merge(PresentationElement, IDataObject, PointF) Merges (i.e., pastes or drops) the ElementGroupPrototype from the IDataObject to the target ModelElement.
Public method MergeElementGroup Merges the source ElementGroup with the specified target ModelElement. (Inherited from ElementOperations.)
Public method MergeElementGroupPrototype(ModelElement, ElementGroupPrototype) (Overrides ElementOperations.MergeElementGroupPrototype(ModelElement, ElementGroupPrototype).)
Public method MergeElementGroupPrototype(ModelElement, ElementGroupPrototype, PointF) Merges the source ElementGroupPrototype with the specified target ModelElement.
Protected method OnElementsReconstituted 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.)
Protected method OnMerged 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. (Overrides ElementOperations.OnMerged(MergeElementGroupEventArgs).)
Protected method OnMerging Called by MergeElementGroupPrototype immediately after the target element has been chosen, but before the elements from the ElementGroupPrototype have been reconstituted. (Inherited from ElementOperations.)
Protected method PropagateElementGroupContextToTransaction (Overrides ElementOperations.PropagateElementGroupContextToTransaction(ModelElement, ElementGroup, Transaction).)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event 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.)
Public event 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.)
Public event 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.)

Top

Fields

  Name Description
Public fieldStatic member TargetDiagramIdContextKey Key of the element Id of the diagram in the TargetConext of merged ElementGroupPrototypes

Top

Remarks

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Modeling.Diagrams Namespace