[]
        
(Showing Draft Content)

C1.Schedule.BaseStorage-2

BaseStorage<T, TMappingCollection> Class

The BaseStorage<T, TMappingCollection> is the base generic component for all storages in C1Schedule object model. Represents a storage of objects derived from BasePersistableObject. This component implements methods of operations over the collections of objects. It allows the collection to be populated programmatically or automatically by retrieving data from the data source which is specified by the DataSource and DataMember properties. It allows mapping of data source fields to the object properties.

Namespace: C1.Schedule
Assembly: C1.ScheduleCore.dll
Syntax
[ComplexBindingProperties("DataSource", "DataMember")]
public class BaseStorage<T, TMappingCollection> : C1BindingSource, IComponent, IDisposable, IBindingListView, IBindingList, IList, ICollection, IEnumerable, ITypedList, ISupportInitializeNotification, ISupportInitialize, ISite, IServiceProvider where T : BasePersistableObject, new() where TMappingCollection : MappingCollectionBase<T>, new()
Type Parameters
Name Description
T

The type of the objects which will be stored in the storage. It should be derived from the BasePersistableObject class and have the default parameter-less constructor.

TMappingCollection

The type of the collection which will be used for mapping. It should be derived from the MappingCollectionBase<T> class and have the default parameter-less constructor.

Constructors

Name Description
BaseStorage(StorageComponent)

Initializes the new instance of the BaseStorage<T, TMappingCollection> component.

Properties

Name Description
BoundMode

Gets a value indicating if the collection is bound to data.

DataKeyNamesInternal

This property is for internal use only.

Mappings

Gets or sets the MappingCollectionBase<T> derived object that allows the properties of objects maintained by the current collection to be bound to the appropriate fields in the data source.

Objects

For internal use only.

ScheduleStorage

Gets the reference to the owning C1ScheduleStorage component.

Methods

Name Description
CommitItemChanges(T)

Commits all changes in the data item.

IsSynchronizable(BasePersistableObject)

Indicates whether the specified collection item should be synchronized.

OnDataSourceItemSynchronized(ItemSynchronizedEventArgs)

Raises the DataSourceItemSynchronized event.

OnListChanged(ListChangedEventArgs)

Translates changes in the internal list to the Objects collection.

RefreshData()

Call this method each time after changing your data source if it doesn't implement IBindingList interface. Or use BaseStorage{T, TMappingCollection}.Add and BaseStorage{T, TMappingCollection}.Remove instead of corresponding methods of your data source class.

Remove(object)

Removes object from the Objects collection.

ShouldSerializeMappings()

Events

Name Description
DataSourceItemSynchronized

Occurs when changes made to the source collection has been fully reflected in the storage underlying data source.