[]
        
(Showing Draft Content)

C1.Win.Data.Entities.C1DataSource

C1DataSource Class

A data source control that simplifies data binding of GUI controls to data in a EntityClientCache. Can be used to bind multiple controls to different queries.

Inheritance
C1DataSource
Namespace: C1.Win.Data.Entities
Assembly: C1.Win.Data.Entity.4.8.dll
Syntax
[ToolboxBitmap(typeof(C1DataSource), "C1DataSource.png")]
public class C1DataSource : Component, IComponent, IDisposable, ISupportInitialize, IListSource, IExtenderProvider, INotifyPropertyChanged
Remarks

To bind a control to data in an EntityClientCache, put a C1DataSource on your form, specify the context type, populate the ViewSources collection with EntityViewSource objects to define views (based on queries), and bind the GUI control to the C1DataSource by setting the GUI control's DataSource and DataMember properties.

Constructors

Name Description
C1DataSource()

Initializes a new instance of the C1DataSource class.

Properties

Name Description
ClientCache

Gets or sets the EntityClientCache used by this C1DataSource to access the data.

ClientScope

Gets the client scope to which this C1DataSource belongs.

ContextType

Gets or sets the type of a System.Data.Entity.DbContext or an System.Data.Objects.ObjectContext used to obtain the default client cache.

DbContext

Gets the System.Data.Entity.DbContext the ClientCache is connected to.

this[int]

Gets the ClientCollectionView of the EntityViewSource at the specified index in the ViewSources collection.

this[string]

Gets the ClientCollectionView of the EntityViewSource with the specified name in the ViewSources collection.

ObjectContext

Gets the System.Data.Objects.ObjectContext the ClientCache is connected to.

RefreshInterval

Gets or sets the interval between automatic Refresh() operations to refresh the data with any changes that may have occurred on the server.

ViewSources

Gets a collection of EntityViewSource objects that define views (based on queries) in this C1DataSource.

Methods

Name Description
BeginInit()
EndInit()
GetControlHandler(Control)

Gets the control handler the specified control is currently handled by.

Load()

Loads all EntityViewSource objects in the ViewSources collection.

Refresh()

Refreshes all EntityViewSource objects in the ViewSources collection.

RejectChanges()

Rejects the changes for every entity in the context.

SaveChanges()

Persists all changes to the server.

SetControlHandler(Control, ControlHandler)

Connects a controlHandler to a given control.

Events

Name Description
SavedChanges

Occurs after a save operation is completed.

SavingChanges

Occurs before changes are saved.