Click or drag to resize

EntityView2<TEntity> Class

EntityView2 provides 'view' capabilities for an entity collection. This class supports filtering and sorting in-memory, using type safe objects. Binding an entity collection to a grid or other complex databinding control will actually make the control bind to an instance of this class.
Inheritance Hierarchy
System.Object
  System.ComponentModel.MarshalByValueComponent
    SD.LLBLGen.Pro.ORMSupportClasses.EntityViewBase<TEntity>
      SD.LLBLGen.Pro.ORMSupportClasses.EntityView2<TEntity>

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.10.0.0 (5.10.0)
Syntax
public class EntityView2<TEntity> : EntityViewBase<TEntity>, 
	IEntityView2, IEnumerable
where TEntity : EntityBase2, IEntity2

Type Parameters

TEntity

The EntityView2<TEntity> type exposes the following members.

Constructors
  NameDescription
Public methodEntityView2<TEntity>(CollectionCore<TEntity>)
CTor
Public methodEntityView2<TEntity>(CollectionCore<TEntity>, IPredicate)
CTor
Public methodEntityView2<TEntity>(CollectionCore<TEntity>, ISortExpression)
CTor
Public methodEntityView2<TEntity>(CollectionCore<TEntity>, Predicate<TEntity>)
CTor
Public methodEntityView2<TEntity>(CollectionCore<TEntity>, IPredicate, ISortExpression)
CTor
Public methodEntityView2<TEntity>(CollectionCore<TEntity>, Predicate<TEntity>, ISortExpression)
CTor
Public methodEntityView2<TEntity>(CollectionCore<TEntity>, IPredicate, ISortExpression, PostCollectionChangeAction)
CTor
Public methodEntityView2<TEntity>(CollectionCore<TEntity>, Predicate<TEntity>, ISortExpression, PostCollectionChangeAction)
CTor
Top
Properties
  NameDescription
Public propertyAllowEdit
Gets / sets whether you can update items in the list.
(Inherited from EntityViewBase<TEntity>.)
Public propertyAllowNew
Gets/sets whether you can add items to the list using AddNew().
(Inherited from EntityViewBase<TEntity>.)
Public propertyAllowRemove
Gets whether you can remove items from the list, using Remove(Object) or RemoveAt(Int32).
(Inherited from EntityViewBase<TEntity>.)
Public propertyContainer
Gets the container for the component.
(Inherited from MarshalByValueComponent.)
Public propertyCount
Gets the number of elements contained in the ICollection.
(Inherited from EntityViewBase<TEntity>.)
Public propertyDataChangeAction
Gets or sets the data change action which specifies what to do when the data in the related collection of an entity view changes. A change in data can be: entity added or changed. If an entity is removed from the underlying collection, the entity is simply removed from the entity view, as the view doesn't contain any data by itself.
(Inherited from EntityViewBase<TEntity>.)
Public propertyDesignMode
Gets a value indicating whether the component is currently in design mode.
(Inherited from MarshalByValueComponent.)
Protected propertyEntityIndices
Gets the entity indices for the entities which are in this view, in the order sorted by the sorter set.
(Inherited from EntityViewBase<TEntity>.)
Protected propertyEvents
Gets the list of event handlers that are attached to this component.
(Inherited from MarshalByValueComponent.)
Public propertyFilter
Gets or sets the filter to use for this entity view.
(Inherited from EntityViewBase<TEntity>.)
Public propertyIsSorted
Gets whether the items in the list are sorted.
(Inherited from EntityViewBase<TEntity>.)
Public propertyItem
Gets the element at the specified index in this view.
(Inherited from EntityViewBase<TEntity>.)
Public propertyRaisesItemChangedEvents
Gets a value indicating whether the IRaiseItemChangedEvents object raises ListChanged events.
(Inherited from EntityViewBase<TEntity>.)
Public propertyRelatedCollection
Gets the related collection set for this view.
Protected propertyRelatedCollectionInternal
Gets the related collection using a property which is solely for internal usage. This is then used by the derived classes to expose the collection in a more typed manner.
(Inherited from EntityViewBase<TEntity>.)
Public propertySite
Gets or sets the site of the component.
(Inherited from MarshalByValueComponent.)
Public propertySortDirection
IBindingList member. Gets the direction of the sort. This property returns the value of the first SortClause in the set sorter.
(Inherited from EntityViewBase<TEntity>.)
Public propertySorter
Gets or sets the sorter for this entity view. Setting this property will re-sort the view and will reset the view in databinding scenario's.
(Inherited from EntityViewBase<TEntity>.)
Public propertySortProperty
Gets the PropertyDescriptor that is being used for sorting.
(Inherited from EntityViewBase<TEntity>.)
Top
Methods
  NameDescription
Protected methodAddNew
Adds a new entity through databinding.
(Inherited from EntityViewBase<TEntity>.)
Protected methodApplySort(ListSortDescriptionCollection)
Sorts the data source based on the given ListSortDescriptionCollection.
(Inherited from EntityViewBase<TEntity>.)
Protected methodApplySort(PropertyDescriptor, ListSortDirection)
Sorts the list based on a PropertyDescriptor and a ListSortDirection.
(Inherited from EntityViewBase<TEntity>.)
Public methodContains
Determines whether this entity view contains the entity passed in. This method returns false if the entity is outside the filter, but in the related entity collection, as it's then not contained in the entity view.
(Inherited from EntityViewBase<TEntity>.)
Public methodCopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
(Inherited from EntityViewBase<TEntity>.)
Protected methodCreateDummyInstance
Creates a dummy instance for the related entity collection of this view. This is done using the entityfactory of that entitycollection.
(Overrides EntityViewBase<TEntity>.CreateDummyInstance().)
Public methodCreateProjection(List<IEntityPropertyProjector>, IEntityCollection2)
Projects the data in the view onto a new set, stored in an entity collection using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, IEntityDataProjector)
Projects the data in the view onto a new set, stored in a collection using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, DataTable)
Projects the data in the view onto a new set, stored in a datatable using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, IEntityCollection2, Boolean)
Projects the data in the view onto a new set, stored in an entity collection using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, IEntityDataProjector, Boolean)
Projects the data in the view onto a new set, stored in a collection using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, DataTable, Boolean)
Projects the data in the view onto a new set, stored in a datatable using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, IEntityCollection2, Boolean, IPredicate)
Projects the data in the view onto a new set, stored in an entity collection using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, IEntityDataProjector, Boolean, IPredicate)
Projects the data in the view onto a new set, stored in a collection using the property projector objects to produce the actual data.
Public methodCreateProjection(List<IEntityPropertyProjector>, DataTable, Boolean, IPredicate)
Projects the data in the view onto a new set, stored in a datatable using the property projector objects to produce the actual data.
Protected methodCreateProjection(List<IEntityPropertyProjector>, Boolean, IPredicate, IEntityDataProjector)
Creates a projection of the current view data, using the passed in field projections and the projector.
(Inherited from EntityViewBase<TEntity>.)
Public methodDispose()
Releases all resources used by the MarshalByValueComponent.
(Inherited from MarshalByValueComponent.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the MarshalByValueComponent and optionally releases the managed resources.
(Inherited from EntityViewBase<TEntity>.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Inherited from MarshalByValueComponent.)
Protected methodFind
Returns the index of the row that has the given PropertyDescriptor.
(Inherited from EntityViewBase<TEntity>.)
Protected methodGetEntityAtIndex
Gets the entity at the specofied index in the view.
(Inherited from EntityViewBase<TEntity>.)
Protected methodGetEntityFieldPropertyDescriptors
Gets the entity field property descriptors for the dummy instance passed in.
(Inherited from EntityViewBase<TEntity>.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetItemProperties
Returns the PropertyDescriptorCollection that represents the properties on each item used to bind data.
(Inherited from EntityViewBase<TEntity>.)
Public methodGetListName
Returns the name of the list.
(Inherited from EntityViewBase<TEntity>.)
Public methodGetPropertyDescriptors
Gets the property descriptors for the entity passed in. This is a dummy instance, and used to produce the property descriptors.
(Inherited from EntityViewBase<TEntity>.)
Public methodGetService
Gets the implementer of the IServiceProvider.
(Inherited from MarshalByValueComponent.)
Protected methodGetSortProperty
Gets the property descriptor for the first sortclause.
(Overrides EntityViewBase<TEntity>.GetSortProperty(ISortExpression).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf
Determines the index of the entity passed in in the entity view in filtered and sorted state.
(Inherited from EntityViewBase<TEntity>.)
Protected methodInitClassCore
Inits the class.
(Inherited from EntityViewBase<TEntity>.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnListChanged
Called when something changes in the related list or this view.
(Inherited from EntityViewBase<TEntity>.)
Public methodRefresh
Refreshes this view by re-applying filter and sorter on the related collection
(Inherited from EntityViewBase<TEntity>.)
Protected methodRemove
Removes the specified entity from the related collection, if the entity is in the view.
(Inherited from EntityViewBase<TEntity>.)
Protected methodRemoveAt
Removes the item at the specified index in this view from the related collection
(Inherited from EntityViewBase<TEntity>.)
Protected methodRemoveSort
Removes any sort applied using ApplySort(PropertyDescriptor, ListSortDirection).
(Inherited from EntityViewBase<TEntity>.)
Protected methodSetFilter
Applies the filter specified to the set related collection
(Inherited from EntityViewBase<TEntity>.)
Protected methodSetSorter
Sets the sort expression for the filtered entities in this view. It sorts the entities which are in this view,
(Inherited from EntityViewBase<TEntity>.)
Public methodToEntityCollection()
Copies all entities in this view to a new entity collection and returns that collection. The returned collection is of the same type as the related collection. Entities aren't copied, just references to the entities.
Public methodToEntityCollection(Int32)
Copies all entities starting at startIndex in this view to a new entity collection and returns that collection. The returned collection is of the same type as the related collection. Entities aren't copied, just references to the entities.
Public methodToString
Returns a String containing the name of the Component, if any. This method should not be overridden.
(Inherited from MarshalByValueComponent.)
Top
Events
  NameDescription
Public eventDisposed
Adds an event handler to listen to the Disposed event on the component.
(Inherited from MarshalByValueComponent.)
Public eventListChanged
Event which is fired when the entity collection related to this entityview is changed.
(Inherited from EntityViewBase<TEntity>.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIList.Add
Not supported. Use AddNew() or add a new object to the related entity collection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingList.AddIndex
Adds the PropertyDescriptor to the indexes used for searching.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingList.AddNew
Adds a new item to the list.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.AllowEdit
Gets whether you can update items in the list.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.AllowNew (Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.AllowRemove
Gets whether you can remove items from the list, using Remove(Object) or RemoveAt(Int32).
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingList.ApplySort
Sorts the list based on a PropertyDescriptor and a ListSortDirection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingListView.ApplySort
Sorts the data source based on the given ListSortDescriptionCollection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIList.Clear
Not supported. Clear the related entity collection instead.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIList.Contains
Determines whether the IList contains a specific value.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodICollection.CopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyICollection.Count
Gets the number of elements contained in the ICollection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingListView.Filter
Gets or sets the filter to be used to exclude items from the collection of items returned by the data source
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingList.Find
Returns the index of the row that has the given PropertyDescriptor.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIEnumerable<TEntity>.GetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIEnumerable.GetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIList.IndexOf
Determines the index of a specific item in the IList.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIList.Insert
Not supported. Insert a new entity in the related collection instead.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIList.IsFixedSize
Returns false
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIList.IsReadOnly
Returns false.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.IsSorted
Gets whether the items in the list are sorted.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyICollection.IsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIList.Item
Indexer via IList. Setter isn't supported, getter returns the typed indexer's value.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIList.Remove
Not supported. Remove the entity from the related collection instead.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIList.RemoveAt
Not supported. Remove the entity from the related collection instead.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingListView.RemoveFilter
Removes the current filter applied to the data source.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingList.RemoveIndex
Removes the PropertyDescriptor from the indexes used for searching.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIBindingList.RemoveSort
Removes any sort applied using ApplySort(PropertyDescriptor, ListSortDirection).
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingListView.SortDescriptions
Gets the collection of sort descriptions currently applied to the data source.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.SortDirection
Gets the direction of the sort.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.SortProperty
Gets the PropertyDescriptor that is being used for sorting.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingListView.SupportsAdvancedSorting
Gets a value indicating whether the data source supports advanced sorting.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.SupportsChangeNotification
Gets whether a ListChanged event is raised when the list changes or an item in the list changes.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingListView.SupportsFiltering
Gets a value indicating whether the data source supports filtering.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.SupportsSearching
Gets whether the list supports searching using the Find(PropertyDescriptor, Object) method.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIBindingList.SupportsSorting
Gets whether the list supports sorting.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyICollection.SyncRoot
Gets an object that can be used to synchronize access to the ICollection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIEntityView2.Contains
Determines whether this entity view contains the entity passed in. This method returns false if the entity is outside the filter, but in the related entity collection, as it's then not contained in the entity view.
Explicit interface implementationPrivate methodIEntityView2.CreateProjection(List<IEntityPropertyProjector>, IEntityCollection2)
Projects the data in the view onto a new set, stored in an entity collection using the property projector objects to produce the actual data.
Explicit interface implementationPrivate methodIEntityView2.CreateProjection(List<IEntityPropertyProjector>, IEntityCollection2, Boolean)
Projects the data in the view onto a new set, stored in an entity collection using the property projector objects to produce the actual data.
Explicit interface implementationPrivate methodIEntityView2.CreateProjection(List<IEntityPropertyProjector>, IEntityCollection2, Boolean, IPredicate)
Projects the data in the view onto a new set, stored in an entity collection using the property projector objects to produce the actual data.
Explicit interface implementationPrivate methodIEntityView2.IndexOf
Determines the index of the entity passed in in the entity view in filtered and sorted state.
Explicit interface implementationPrivate propertyIEntityView2.Item
Gets the IEntity2 at the specified index in the view
Explicit interface implementationPrivate propertyIEntityView2.RelatedCollection
Gets the related collection set for this view.
Explicit interface implementationPrivate methodIEntityView2.ToEntityCollection()
Copies all entities in this view to a new entity collection and returns that collection. The returned collection is of the same type as the related collection. Entities aren't copied, just references to the entities.
Explicit interface implementationPrivate methodIEntityView2.ToEntityCollection(Int32)
Copies all entities starting at startIndex in this view to a new entity collection and returns that collection. The returned collection is of the same type as the related collection. Entities aren't copied, just references to the entities.
Explicit interface implementationPrivate propertyIEntityViewCore.AllowEdit
Gets / sets whether you can update items in the list.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIEntityViewCore.AllowNew
Gets/sets whether you can add items to the list using AddNew().
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIEntityViewCore.AllowRemove
Gets whether you can remove items from the list, using Remove(Object) or RemoveAt(Int32).
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIEntityViewCore.Count
Gets the number of elements contained in the ICollection.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIEntityViewCore.DataChangeAction
Gets or sets the data change action which specifies what to do when the data in the related collection of an entity view changes. A change in data can be: entity added or changed. If an entity is removed from the underlying collection, the entity is simply removed from the entity view, as the view doesn't contain any data by itself.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIEntityViewCore.Filter
Gets or sets the filter to use for this entity view.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIEntityViewCore.IndexOf
Determines the index of the entity passed in in the entity view in filtered and sorted state.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIEntityViewCore.Item
Gets the element at the specified index in this view.
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate methodIEntityViewCore.Refresh
Refreshes this view by re-applying filter and sorter on the related collection
(Inherited from EntityViewBase<TEntity>.)
Explicit interface implementationPrivate propertyIEntityViewCore.Sorter
Gets or sets the sorter for this entity view. Setting this property will re-sort the view and will reset the view in databinding scenario's.
(Inherited from EntityViewBase<TEntity>.)
Top
Remarks
Adapter specific
See Also