ClassBindingProviderBase<T>
Represents a base class for data binding providers that facilitate two-way data binding between scheduler items and external data sources, providing mapping capabilities and change tracking.
Definition
Namespace:Telerik.WinControls.UI.Scheduler
Assembly:Telerik.WinControls.Scheduler.dll
Type Parameters:
T
The type of scheduler item that implements IDataBoundItem.
Syntax:
public abstract class BindingProviderBase<T> : BindingSource, IComponent, IDisposable, IBindingListView, IBindingList, IList, ICollection, IEnumerable, ITypedList, ICancelAddNew, ISupportInitializeNotification, ISupportInitialize, ICurrencyManagerProvider, ISchedulerProvider<T> where T : IDataBoundItem
Inheritance: objectMarshalByRefObjectComponentBindingSourceBindingProviderBase<T>
Derived Classes:
Implements:
Inherited Members
Constructors
BindingProviderBase(SchedulerBindingDataSource)
Initializes a new instance of the BindingProviderBase<T> class with the specified data source owner.
Declaration
protected BindingProviderBase(SchedulerBindingDataSource owner)
Parameters
owner
The SchedulerBindingDataSource that owns this binding provider.
Fields
schedulerItems
Declaration
protected List<T> schedulerItems
Field Value
List<T>
Properties
Mapping
Gets or sets the mapping information that defines how properties of scheduler items correspond to properties in the data source, enabling bidirectional data binding.
Declaration
public virtual IMappingInfo Mapping { get; set; }
Property Value
Implements
TrackDataSourceChanges
Gets or sets a value indicating whether changes to the underlying data source should be tracked and synchronized with scheduler items.
Methods
CreateInstance()
When overridden in a derived class, creates a new instance of the specific scheduler item type.
Declaration
protected abstract T CreateInstance()
Returns
T
A new instance of type T.
Delete(T)
Deletes a scheduler item from the data source and removes it from the scheduler items collection.
Declaration
public virtual void Delete(T itemToDelete)
Parameters
itemToDelete
T
The scheduler item to delete from the data source.
Implements
DeleteCore(T)
Performs the core deletion logic for removing a scheduler item from the data source.
Declaration
protected virtual void DeleteCore(T itemToDelete)
Parameters
itemToDelete
T
The scheduler item to delete.
FindDataSourceProperty(SchedulerMapping)
Finds a property descriptor in the data source properties collection that matches the specified mapping.
Declaration
protected PropertyDescriptor FindDataSourceProperty(SchedulerMapping mapping)
Parameters
mapping
The scheduler mapping that defines the data source property to find.
Returns
The PropertyDescriptor for the data source property, or null if not found.
GetItems(Predicate<T>)
Retrieves scheduler items from the data source, optionally applying a filter function.
Declaration
public IEnumerable<T> GetItems(Predicate<T> filterFunction)
Parameters
filterFunction
Predicate<T>
An optional filter function to apply when retrieving items. If null, all items are returned.
Returns
IEnumerable<T>
An enumerable collection of scheduler items of type T.
Implements
GetSourcePropertyName(PropertyDescriptor)
Gets the name of a data source property, allowing for custom property name transformations. Override this method to implement custom property naming strategies.
Declaration
protected virtual string GetSourcePropertyName(PropertyDescriptor property)
Parameters
property
The property descriptor for which to get the name.
Returns
The name to use for the property in data binding operations.
Insert(T)
Inserts a new scheduler item into the data source and synchronizes the change with the underlying data store.
Declaration
public virtual void Insert(T itemToInsert)
Parameters
itemToInsert
T
The scheduler item to insert into the data source.
Implements
InsertCore(T)
Performs the core insertion logic for adding a scheduler item to the data source.
Declaration
protected virtual void InsertCore(T itemToInsert)
Parameters
itemToInsert
T
The scheduler item to insert.
OnCreateSchedulerItemsBegin(PropertyDescriptorCollection)
Called before the process of extracting scheduler items from the data source begins. Override this method to perform initialization or preparation tasks.
Declaration
protected virtual void OnCreateSchedulerItemsBegin(PropertyDescriptorCollection properties)
Parameters
properties
The collection of properties available on the data source items.
OnCreateSchedulerItemsEnd()
Called after the process of extracting scheduler items from the data source completes. Override this method to perform cleanup or finalization tasks.
Declaration
protected virtual void OnCreateSchedulerItemsEnd()
OnDataMemberChanged(EventArgs)
Raises the DataMemberChanged event and updates the data properties cache.
OnDataSourceChanged(EventArgs)
Raises the DataSourceChanged event and updates the data properties cache.
OnItemsChanged(ListChangedEventArgs<T>)
Raises the ItemsChanged event to notify subscribers of changes to the scheduler items collection.
Declaration
protected virtual void OnItemsChanged(ListChangedEventArgs<T> args)
Parameters
args
The ListChangedEventArgs<T> instance containing the event data.
OnListChanged(ListChangedEventArgs)
Raises the ListChanged event and handles synchronization between the data source and scheduler items.
Declaration
protected override void OnListChanged(ListChangedEventArgs e)
Parameters
e
A ListChangedEventArgs that contains the event data.
Overrides
ProcessDataSourceValue(T, SchedulerMapping, object)
Called to process a value from the data source when the corresponding scheduler item property cannot be found or when custom processing is required. Override this method to handle complex mappings.
Declaration
protected virtual void ProcessDataSourceValue(T schedulerItem, SchedulerMapping mapping, object value)
Parameters
schedulerItem
T
The scheduler item being populated.
mapping
The mapping configuration for the current property.
value
The value from the data source that needs processing.
ProcessSchedulerItem(T, object, SchedulerMapping, PropertyDescriptor)
Called to process a scheduler item value when updating the data source and custom processing is required. Override this method to handle complex mappings during data source updates.
Declaration
protected virtual void ProcessSchedulerItem(T schedulerItem, object dataSourceItem, SchedulerMapping mapping, PropertyDescriptor dataItemProperty)
Parameters
schedulerItem
T
The scheduler item containing the source value.
dataSourceItem
The data source item being updated.
mapping
The mapping configuration for the current property.
dataItemProperty
The property descriptor for the data source property being updated.
ReadSchedulerItem(T, object)
Populates a scheduler item with data from the corresponding data source item using the configured property mappings.
Declaration
protected virtual void ReadSchedulerItem(T schedulerItem, object item)
Parameters
schedulerItem
T
The scheduler item to populate with data.
item
The data source item containing the source data.
ShouldApplyMapping(SchedulerMapping)
Determines whether a specific mapping should be applied during data binding operations. Override this method to implement conditional mapping logic.
Declaration
protected virtual bool ShouldApplyMapping(SchedulerMapping mapping)
Parameters
mapping
The scheduler mapping to evaluate.
Returns
true if the mapping should be applied; otherwise, false.
ShouldReadDataItem(object)
Determines whether a specific data source item should be processed and converted to a scheduler item. Override this method to implement custom filtering logic during data source enumeration.
Update(T, string)
Updates an existing scheduler item in the data source with new property values.
Declaration
public virtual void Update(T itemToUpdate, string propertyName)
Parameters
itemToUpdate
T
The scheduler item to update in the data source.
propertyName
The name of the specific property that changed, or null/empty to update all properties.
Implements
UpdateChildItems()
Updates any child or related items after a modification operation. Override this method to provide custom child item synchronization logic.
Declaration
protected virtual void UpdateChildItems()
UpdateCore(T, string)
Performs the core update logic for modifying a scheduler item in the data source.
Declaration
protected virtual void UpdateCore(T itemToUpdate, string propertyName)
Parameters
itemToUpdate
T
The scheduler item to update.
propertyName
The name of the specific property that changed, or null/empty to update all properties.
UpdateDataItem(T, object, string)
Updates the properties of a data source item with values from the corresponding scheduler item.
Declaration
protected void UpdateDataItem(T itemToUpdate, object dataItem, string propertyName)
Parameters
itemToUpdate
T
The scheduler item containing the source values.
dataItem
The data source item to update.
propertyName
The name of the specific property to update, or null/empty to update all properties.
UpdateDataItemProperties(object, T)
Updates all mapped properties of a data source item with values from the corresponding scheduler item.
Declaration
protected virtual void UpdateDataItemProperties(object item, T schedulerItem)
Parameters
item
The data source item to update.
schedulerItem
T
The scheduler item containing the source values.
UpdateDataItemProperty(object, T, SchedulerMapping)
Updates a specific property of a data source item with the corresponding value from a scheduler item using the provided mapping.
Declaration
protected virtual bool UpdateDataItemProperty(object item, T schedulerItem, SchedulerMapping mapping)
Parameters
item
The data source item to update.
schedulerItem
T
The scheduler item containing the source value.
mapping
The mapping configuration that defines the property relationship.
Returns
true if the property was successfully updated; otherwise, false.
UpdateDataPropertiesCache()
Updates the cached collection of data source property descriptors based on the current data list.
Declaration
protected void UpdateDataPropertiesCache()
UpdateSchedulerPropertiesCache()
Updates the cached collection of scheduler item property descriptors based on the current scheduler item type.
Declaration
protected void UpdateSchedulerPropertiesCache()
Events
ItemsChanged
Occurs when the scheduler items collection changes due to data source modifications.
Declaration
public event EventHandler<ListChangedEventArgs<T>> ItemsChanged
Event Value
Implements