Share via


ModelingPartitionMapper Class

Determines the partition for a particular model element or class.

This API is not CLS-compliant. 

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Shell.ModelingPartitionMapper

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

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Class ModelingPartitionMapper _
    Implements IElementPartitionMapper, SElementPartitionMapper
[CLSCompliantAttribute(false)]
public class ModelingPartitionMapper : IElementPartitionMapper, 
    SElementPartitionMapper
[CLSCompliantAttribute(false)]
public ref class ModelingPartitionMapper : IElementPartitionMapper, 
    SElementPartitionMapper
[<CLSCompliantAttribute(false)>]
type ModelingPartitionMapper =  
    class
        interface IElementPartitionMapper
        interface SElementPartitionMapper
    end
public class ModelingPartitionMapper implements IElementPartitionMapper, SElementPartitionMapper

The ModelingPartitionMapper type exposes the following members.

Constructors

  Name Description
Protected method ModelingPartitionMapper

Top

Properties

  Name Description
Protected property RootElement

Top

Methods

  Name Description
Public method BeginMapping
Protected method DeterminePartitionForElement Determine the partition to use for a particular ProtoElement.
Public method EndMapping
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.)
Protected method FindDiagramPartition(Partition)
Protected method FindDiagramPartition(ElementGroupPrototype, Partition) Find the correct diagram partition for a merge of the specified ElementGroupPrototype
Protected method FindPartitions Determine the correct model and diagram partitions for a merge of the specified ElementGroupPrototype
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method PartitionForClass
Public method PartitionForElement
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Protected method WhichPartitionForClass Find which of the modeling partitions should be used for creating an instance of the specified domain class.

Top

Remarks

Default Modeling framework partition mapping service. This mapper is capable of mapping to two partitions, one for the model, and one for the diagram. The model partition is assumed to be fixed as the partition of the model root associated with the docdata. The diagram partition may vary, and the particular diagram to use is dynamically determined by looking for a target diagram id in the ElementGroupPrototype's target context. The standard DesignSurfaceElementOperations puts the target diagram over which a drag-over or drop operation occurs into the EGP target context. If the target diagram id is not present in the EGP target context, then this partition mapper assumes that the relevant diagram is the first diagram associated with the model. A limitation of this mapper is that it can only map any particular domain class to a single partition, based upon the first embedding defined for the class. Designers requiring a more sophisticated partition mapping service are free to subclass this partition mapper (it provides a couple of override points), or completely replace it, e.g. by overriding ModelingDocData.CreatePartitionMapper, or by providing it as an SElementPartitionMapper through the service provider provided to the Store at creation time.

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.Shell Namespace