Click or drag to resize

CollectionCoreT Class

Generic base class for the entity collection classes used by Selfservicing and adapter. This class is mainly written to be able to tap into Add/Remove/Insert etc. without problems: the shipped collection classes in .NET don't have the ability to override Add etc.
Inheritance Hierarchy

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.7.0.0 (5.7.0)
Syntax
[SerializableAttribute]
public abstract class CollectionCore<T> : IList<T>, 
	ICollection<T>, IEnumerable<T>, IEnumerable, IList, ICollection, 
	IEntityCollectionCore, IActiveContextParticipant, ISerializable, IComponent, IDisposable
where T : class, IEntityCore

Type Parameters

T
The type this collection is of (the type of the contained objects.)

The CollectionCoreT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyActiveContext
Gets / sets the active context this entity collection is in. Setting this property is not adding the entity collection to the context, it will make contained entities be added to the passed in context. If the entity collection is already in a context, setting this property has no effect. Setting this property is done by framework code, use the Context's Add/Get methods to work with contexts and entity collections.
Public propertyAllowEdit
Default: true. If set to false, entities inside this collection won't be editable in a complex databinding scenario.
Public propertyAllowNew
Default: true. If set to false, no new entities will be added through databinding.
Public propertyAllowRemove
Default: false. If set to true, entities can be removed through databinding.
Public propertyCapacity
Gets / sets the initial capacity of the entity collection.
Public propertyConcurrencyPredicateFactoryToUse
Gets / sets the IConcurrencyPredicateFactory instance to use when creating entity objects during a GetMulti() call or when AddNew is called.
Protected propertyContainingEntityMappedField
Gets the name of the field mapped onto the relation in the opposite entity which is represented by this collection, if this collection is contained by an entity. E.g. it will return "Customer" if the relation Customer - Order has the field 'Customer' mapped onto it in Order and this collection is the Orders collection in Customer. If this collection isn't contained in any entity, an empty string is returned.
Public propertyCount
Protected propertyDeserializationInProgress
Gets or sets a value indicating whether [deserialization in progress].
Public propertyDirtyEntities
Returns a readonly collection of entities which are flagged as dirty. This collection is determined on the fly, you can use this collection to remove dirty entities from this entity collection.
Public propertyDoNotPerformAddIfPresent
When set to true, an entity passed to Add() or Insert() will be tested if it's already present. If so, the index is returned and the object is not added again. If set to false (default) this check is not performed. Setting this property to true can slow down fetch logic.
Protected propertyEntityFactoryToUseInternal
Gets or sets the actual entity factory to use
Public propertyEntityValidatorToUse Obsolete.
Obsolete. Collections don't store validator objects anymore. Present to make sure users can continue designing their forms in vs.net
Public propertyIsReadOnly
Public propertyItem
Gets or sets the object at the specified index.
Public propertyItems
Items contained by this collection. Returns simply this instance.
Protected propertyRemovedEntitiesTrackerInternal
Gets/sets the actual removed entities tracker collection.
Public propertySite
Gets or sets the ISite associated with the IComponent.
Protected propertySuppressListChangedEventsInternal
Gets or sets a value indicating whether [surpress list changed events].
Public propertyValidatorToUse Obsolete.
Obsolete. Collections don't store validator objects anymore. Present to make sure users can continue designing their forms in vs.net
Top
Methods
  NameDescription
Public methodAdd
Protected methodAddContainedEntitiesToContext
Adds the contained entities to the active set context.
Public methodAddNew
Will add a new entity to the list, will set its parent collection property so CancelEdit will remove it from the list again, and will set its flag that it is added by databinding.
Public methodAddRange
Adds the range of objects passed in.
Public methodClear
Public methodClear(Boolean)
Public methodContains
Public methodCopyTo
Public methodDispose
Disposes this instance.
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFindMatches
Gets all indices of all the entities in the current order of this collection which match the passed in filter.
Protected methodGetEntityDescription
Gets the entity description for the entity passed in.
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetObjectData
ISerializable member.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf
Protected methodInitCoreClass
Inits the core class.
Public methodInsert
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnDeserialized
Called at the end of the deserialization constructor. Method is used when this object is deserialized. Override this method to tap into the deserialization sequence. (binary/soap formatter specific).
Protected methodOnEntityAdded
Called at the end of the Add or Insert routine which adds an entity to this collection. Will raise EntityAdded event.
Protected methodOnEntityAdding
Called at the start of the Add or Insert routine which adds an entity to this collection. Will raise EntityAdding event.
Protected methodOnEntityInListOnEntityContentsChanged
Event handler for the EntityContentsChanged event.
Protected methodOnEntityRemoved
Called at the end of a remove routine which removes an entity from this collection. Will raise EntityRemoved event.
Protected methodOnEntityRemoving
Called at the start of a remove routine which removes an entity from this collection. Will raise EntityRemoving event.
Protected methodOnGetObjectData
Called at the end of GetObjectData. Method is used when this object is serialized. Override this method to tap into the serialization sequence. (binary/soap formatter specific).
Protected methodOnListChanged
Called when [list changed].
Protected methodPerformAddToActiveContext
Performs the add action to the active context for this collection
Protected methodPerformSetRelatedEntity
Performs the set related entity action on the passed in entity. This action is delegated to an inheritor.
Protected methodPerformUnsetRelatedEntity
Performs the unset related entity action on the passed in entity. This action is delegated to an inheritor.
Protected methodPlaceInRemovedEntitiesTracker
Places the item in the set RemovedEntitiesTracker.
Public methodRemove
Public methodRemoveAt
Public methodRemoveRange
Removes the elements in the range specified from this collection.
Protected methodSilentRemove
Removes the passed in entity from the collection without notifying the entity to remove that it has been removed from this collection.
Public methodSort(Int32, ListSortDirection)
Applies sorting like IBindingList.ApplySort, on the field with the index fieldIndex and with the direction specified.
Protected methodSort(PropertyDescriptor, ListSortDirection, IComparerObject)
Sorts the collection.
Public methodSort(Int32, ListSortDirection, IComparerObject)
Sorts the collection.
Public methodSort(String, ListSortDirection, IComparerObject)
Sorts the collection.
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Top
Events
  NameDescription
Public eventDisposed
IComponent's Disposed event.
Public eventEntityAdded
Event which is raised at the End of the Add or Insert(index) routine.
Public eventEntityAdding
Event which is raised at the start of the Add or Insert(index) routine. To cancel the addition action, set cancel to true.
Public eventEntityRemoved
Event which is raised at the End of the Remove or RemoveAt(index) routine.
Public eventEntityRemoving
Event which is raised at the start of the Remove or RemoveAt(index) routine. To cancel the remove action, set cancel to true.
Public eventListChanged
Event which is used in complex databinding.
Top
Extension Methods
  NameDescription
Public Extension MethodExcludeT
Defines a set of fields to exclude. For prefetch path definitions
(Defined by PrefetchExtensions.)
Public Extension MethodFilterByT
Defines a predicate on the collection specified. For prefetch path definitions
(Defined by PrefetchExtensions.)
Public Extension MethodIncludeT
Defines a set of fields to include, excluding all other fields. For prefetch path definitions
(Defined by PrefetchExtensions.)
Public Extension MethodLimitToT
Defines a limit on the collection specified. For prefetch path definitions
(Defined by PrefetchExtensions.)
Public Extension MethodSortByT
Defines an ordering definition (ascending) on the collection specified. For prefetch path definitions
(Defined by PrefetchExtensions.)
Public Extension MethodSortByDescendingT
Defines an ordering definition (descending) on the collection specified. For prefetch path definitions
(Defined by PrefetchExtensions.)
Public Extension MethodWithT(ExpressionFuncT, Object)Overloaded.
Defines one or more nodes to fetch, related to the specified entity set. For prefetch path definitions
(Defined by PrefetchExtensions.)
Public Extension MethodWithT(IEnumerableExpressionFuncT, Object)Overloaded.
Defines one or more nodes to fetch, related to the specified entity set. For prefetch path definitions
(Defined by PrefetchExtensions.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIListAdd
Adds an item to the IList.
Explicit interface implementationPrivate methodIListClear
Explicit interface implementationPrivate methodIListContains
Determines whether the IList contains a specific value.
Explicit interface implementationPrivate methodICollectionCopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
Explicit interface implementationPrivate propertyICollectionCount
Explicit interface implementationPrivate methodIEnumerableGetEnumerator
Returns an enumerator that iterates through a collection.
Explicit interface implementationPrivate methodIListIndexOf
Determines the index of a specific item in the IList.
Explicit interface implementationPrivate methodIListInsert
Inserts an item to the IList at the specified index.
Explicit interface implementationPrivate propertyIListIsFixedSize
Gets a value indicating whether the IList has a fixed size.
Explicit interface implementationPrivate propertyIListIsReadOnly
Explicit interface implementationPrivate propertyICollectionIsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
Explicit interface implementationPrivate propertyIListItem
Gets or sets the Object at the specified index.
Explicit interface implementationPrivate methodIListRemove
Removes the first occurrence of a specific object from the IList.
Explicit interface implementationPrivate methodIListRemoveAt
Explicit interface implementationPrivate propertyICollectionSyncRoot
Gets an object that can be used to synchronize access to the ICollection.
Explicit interface implementationPrivate methodIEntityCollectionCoreAdd
Adds an IEntityCore object to the list.
Explicit interface implementationPrivate methodIEntityCollectionCoreClear
Clears the collection
Explicit interface implementationPrivate methodIEntityCollectionCoreClear(Boolean)
Clears the collection
Explicit interface implementationPrivate propertyIEntityCollectionCoreContainingEntityMappedField
Gets the name of the field mapped onto the relation in the opposite entity which is represented by this collection, if this collection is contained by an entity. E.g. it will return "Customer" if the relation Customer - Order has the field 'Customer' mapped onto it in Order and this collection is the Orders collection in Customer. If this collection isn't contained in any entity, an empty string is returned.
Explicit interface implementationPrivate methodIEntityCollectionCoreContains
Returns true if the list contains the given entity
Explicit interface implementationPrivate propertyIEntityCollectionCoreEntityFactoryToUse
The EntityFactory to use when creating entity objects during fetch action or other logic which requires the creation of new entities.
Explicit interface implementationPrivate methodIEntityCollectionCoreFindMatches
Gets all indices of all the entities in the current order of this collection which match the passed in filter.
Explicit interface implementationPrivate methodIEntityCollectionCoreIndexOf
Returns index in the list of given entity.
Explicit interface implementationPrivate methodIEntityCollectionCoreInsert
Inserts an IEntityCore on position Index
Explicit interface implementationPrivate propertyIEntityCollectionCoreIsForMN
Gets or sets a value indicating whether this instance is for a M:N relationship. If set to true, it will also set IsReadOnly to true.
Explicit interface implementationPrivate propertyIEntityCollectionCoreIsRemovalTracker
Gets or sets a value indicating whether this instance is a removal tracker collection.
Explicit interface implementationPrivate propertyIEntityCollectionCoreItem
Simple indexer.
Explicit interface implementationPrivate methodIEntityCollectionCoreRemove
Remove given IEntityCore instance from the list.
Explicit interface implementationPrivate propertyIEntityCollectionCoreRemovedEntitiesTracker
Gets or sets the removal tracker for this entity collection
Top
See Also