CollectionDef Object
A collection type (or collection definition) defines how instances of a particular type of collection will behave. The properties of the collection type determine:
- The minimum and maximum number of items in a collection.
- Whether the collection type is an origin collection type.
- Whether the collection type permits the naming of destination objects, and if so, whether those names are case-sensitive, and required to be unique.
- Whether the collection type permits the explicit sequencing of items in the collection.
- What happens to related objects when objects or relationships in the collection are deleted.
- Whether origin collections of this type are automatically copied to new object versions by the CreateVersion method.
- Whether the MergeVersion method combines origin collections of this type as a whole, or item-by-item.
- Whether the FreezeVersion method requires that destination object versions of relationships of this type be frozen before the attendant origin object versions can be frozen.
The kind of relationship that a particular collection type uses to relate objects to each other is determined by its CollectionItem collection. The CollectionItem collection associates a single relationship type to the collection type. To add a new collection type, use the InterfaceDef object.
A CollectionDef object is also a RepositoryObject and a RepositoryObjectVersion object. In addition to the members described here, you can access members that are defined for those objects as well as members of IInterfaceMember2 and IVersionAdminInfo. For more information about accessing a member of an interface that is not the default interface, see Accessing Automation Object Members.
When to Use
Use the CollectionDef object to retrieve or modify the properties of a collection type, to determine the kind of relationship that the collection implements, or to determine the interface to which the collection is attached.
Properties
Property | Description |
---|---|
DispatchID | The dispatch identifier to use when accessing an instance of this type of collection |
Flags | Flags that specify details about this collection definition |
IsOrigin | Indicates whether collections of this type are origin collections |
MemberSynonym | Stores a synonym of the collection name |
MaxCount | The maximum number of target objects that can be contained in a collection of this type |
MinCount | The minimum number of target objects that must be contained in a collection of this type |
Name | Stores the name of a collection |
Collections
Collection | Description |
---|---|
CollectionItem | The collection of one relationship type that defines the relationship between target objects of this type of collection and a single source object |
Interface | The interface to which this collection definition is attached |
Properties | The collection of all persistent properties that are attached to the CollectionDef object |