Partilhar via


Partition Class

Provides a logical container for elements in a store.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Partition

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

Syntax

'Declaração
Public NotInheritable Class Partition _
    Implements IDisposable
public sealed class Partition : IDisposable
public ref class Partition sealed : IDisposable
[<Sealed>]
type Partition =  
    class
        interface IDisposable
    end
public final class Partition implements IDisposable

The Partition type exposes the following members.

Constructors

  Name Description
Public method Partition Constructor

Top

Properties

  Name Description
Public property AlternateId The AlternateId is used in the
Public property Contexts The Contexts that are referenced by the Partition. The Dictionary keys are the IDs of the Contexts. The Dictionary values are the Context instances.
Public property DirtyCount Indicates the number of changes to the Partition.
Public property DomainDataDirectory Gets domain information directory of the Store this partition belongs to.
Public property ElementDirectory Directory of elements contained within partition.
Public property ElementFactory The ElementFactory for the model
Public property Id The Id of this Partition.
Public property IsDirty Indicates true when the Partition is in a dirty state.
Public property IsReadOnly Gets whether this partition is read-only.
Public property StateId A StateId that defines what state this Partition object is in.
Public property Store The Store the Partition belongs to.

Top

Methods

  Name Description
Public method AddContext Add context to partition
Public method DeleteElements Delete the object graphs rooted in the specified collection of elements.
Public method Dispose Disposes the state of this object.
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 FindByAlternateId Find a partition by its AlternateKey
Public method GetClosureList(ICollection<ModelElement>, ClosureType) Gets a closure list of the given type based on the given root element list
Public method GetClosureList(ICollection<ModelElement>, ClosureType, Boolean) Gets a closure list of the given type based on the given root element list
Public method GetClosureList(ICollection<ModelElement>, ClosureType, IEnumerable<DomainRoleInfo>) Gets a closure list of the given type based on the given root element list
Public method GetClosureList(ICollection<ModelElement>, ClosureType, Boolean, IEnumerable<DomainRoleInfo>) Gets a closure list of the given type based on the given root element list
Public method GetClosureList(ICollection<ModelElement>, ClosureType, IEnumerable<DomainRoleInfo>, IEnumerable<DomainRoleInfo>) Gets a closure list of the given type based on the given root element list
Public method GetClosureList(ICollection<ModelElement>, ClosureType, Boolean, IEnumerable<DomainRoleInfo>, IEnumerable<DomainRoleInfo>) Gets a closure list of the given type based on the given root element list
Public method GetClosurePrototypeGroup(ICollection<ModelElement>, ClosureType) Creates an ElementGroupPrototype of the given closure type based on the given list of root Elements
Public method GetClosurePrototypeGroup(ICollection<ModelElement>, ClosureType, Boolean) Creates an ElementGroupPrototype of the given closure type based on the given list of root Elements
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 RemoveContext Method to remove a Context from the Partition
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event PartitionDisposing Allows clients to receive PartitionDisposing events

Top

Extension Methods

  Name Description
Public Extension Method CanDeleteElements 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. (Defined by ImmutabilityExtensionMethods.)
Public Extension Method GetLocks Get the lock flags for this Partition instance. This will include any locks enabled on the Store containing the partition. (Defined by ImmutabilityExtensionMethods.)
Public Extension Method IsLocked Test whether this partition has any of a specified set of locks (Defined by ImmutabilityExtensionMethods.)
Public Extension Method SetLocks Set the lock flags of the specified Partition instance (Defined by ImmutabilityExtensionMethods.)

Top

Remarks

A store can have any number of partitions. In most cases, a store only uses one partition, which is called the default partition. If you don't make any changes to the default behavior, all elements are in the default partition.

When you create an element, you can indicate which partition you want it to be created in.

Partitions provide away for you to divide the elements and links of a model into different logical groups. One reason for using multiple partitions is to isolate the undo and redo actions into different queues in the different partitions. Undo and redo actions are applied to a partition.

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 Namespace

Other Resources

[redirect] Domain Classes in the Generated API

Providing Custom Constructors