private void AsyncServerModeSourceResolveSession(ResolveSessionEventArgs args) { IDisposable[] disposableObjects; IDataStore dataStore = dataStoreProvider.CreateWorkingStore(out disposableObjects); args.Session = CreateUnitOfWork(dataStore, disposableObjects); }
private void xpInstantFeedbackSource1_DismissSession(object sender, ResolveSessionEventArgs e) { IDisposable session1 = e.Session as IDisposable; if (session1 != null) { session1.Dispose(); } }
void instantDS_DismissSession(object sender, ResolveSessionEventArgs e) { IDisposable session = e.Session as IDisposable; if (session != null) { session.Dispose(); } }
private void AsyncServerModeSourceDismissSession(ResolveSessionEventArgs args) { var toDispose = args.Session as IDisposable; if (toDispose != null) { toDispose.Dispose(); } }
void XPInstantFeedbackDataSource_DismissSession(object sender, ResolveSessionEventArgs e) { IDisposable session = e.Session as IDisposable; if (session != null) { session.Dispose(); } }
private void xpInstantFeedbackSource1_ResolveSession(object sender, ResolveSessionEventArgs e) { session1 = new Session() { ConnectionString = MSSqlConnectionProvider.GetConnectionString("(local)", "NorthWind") }; session1.Connect(); e.Session = session1; }
// This event is generated by Data Source Configuration Wizard void xpInstantFeedbackSource1_DismissSession(object sender, ResolveSessionEventArgs e) { // Here you can dismiss the session instance you have assigned to the ResolveSessionEventArgs.Session property in the ResolveSession event handler. IDisposable session = e.Session as IDisposable; if (session != null) { session.Dispose(); } }
private void OnResolveSession(object sender, ResolveSessionEventArgs e) { //Сreate a single instance of IDataLayer if it is not created if (DataLayerInstance == null) { string connectionString = ConfigurationManager.ConnectionStrings["nwind"].ConnectionString; DataLayerInstance = XpoDefault.GetDataLayer(connectionString, DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists); } //Create new session based on the instance of DataLayer e.Session = new UnitOfWork(DataLayerInstance); }
void instantDS_ResolveSession(object sender, ResolveSessionEventArgs e) { Session session = new Session(); session.ConnectionString = $@"XpoProvider=SQLite;Data Source={DBFileName};Read Only=True;"; session.AutoCreateOption = DevExpress.Xpo.DB.AutoCreateOption.None; session.LockingOption = LockingOption.None; session.Connect(); e.Session = session; try { using (var reader = new StreamReader("before_load.sql")) { var commandSQL = new System.Data.SQLite.SQLiteCommand(); commandSQL.Connection = (System.Data.SQLite.SQLiteConnection)session.Connection; commandSQL.CommandText = reader.ReadToEnd(); commandSQL.ExecuteNonQuery(); } }catch (Exception ex) { Console.WriteLine(ex.Message); } }
private void OnDismissSession(object sender, ResolveSessionEventArgs e) { e.Session.Session.Dispose(); }
private void AsyncServerModeSourceDismissSession(ResolveSessionEventArgs args) { var toDispose = args.Session as IDisposable; if (toDispose != null) { toDispose.Dispose(); } }
private void AsyncServerModeSourceResolveSession(ResolveSessionEventArgs args) { IDisposable[] disposableObjects; IDataStore dataStore = DataStoreProvider.CreateWorkingStore(out disposableObjects); args.Session = CreateUnitOfWork(dataStore, disposableObjects); }
private void XPCollection_ResolveSession(object sender, ResolveSessionEventArgs e) { e.Session = BaseSession; }
private void customersXPCollection_ResolveSession(object sender, ResolveSessionEventArgs e) { e.Session = m_CustomersUOW; }
private void OnSuppliersCollectionResolveSession(object sender, ResolveSessionEventArgs e) { e.Session = XpoHelper.GetNewSession(); }
// This event is generated by Data Source Configuration Wizard void xpInstantFeedbackSource1_ResolveSession(object sender, ResolveSessionEventArgs e) { // Assign a session to the Session property, e.Session = new DevExpress.Xpo.UnitOfWork(); }
private void OrdersInstantFeedbackView_ResolveSession(object sender, ResolveSessionEventArgs e) { e.Session = new Session(); }
void instantDS_ResolveSession(object sender, ResolveSessionEventArgs e) { e.Session = new UnitOfWork(); }
void XPInstantFeedbackDataSource_ResolveSession(object sender, ResolveSessionEventArgs e) { Session s = new UnitOfWork(); e.Session = s; }
void OnCollectionResolveSession(object sender, ResolveSessionEventArgs e) { e.Session = new UnitOfWork(); }
private void OrdersInstantFeedbackView_DismissSession(object sender, ResolveSessionEventArgs e) { e.Session.Session.Dispose(); }