示例#1
0
 public TypeContext(DataBase dataBase, IEnumerable <TypeInfo> typeInfos)
 {
     this.dataBase   = dataBase;
     this.repository = dataBase.Repository;
     this.BasePath   = Path.Combine(dataBase.BasePath, CremaSchema.TypeDirectory);
     this.Initialize(typeInfos);
     this.UserContext.Dispatcher.Invoke(() => this.UserContext.Users.UsersLoggedOut += UserCollection_UsersLoggedOut);
     this.CremaHost.Debug("TypeContext is created.");
 }
示例#2
0
 public TableContext(DataBase dataBase, IEnumerable <TableInfo> tableInfos)
 {
     this.dataBase   = dataBase;
     this.repository = dataBase.Repository;
     this.CremaHost.Debug(Resources.Message_TableContextInitialize);
     this.BasePath             = Path.Combine(dataBase.BasePath, CremaSchema.TableDirectory);
     this.Tables.TypeReference = dataBase.TypeContext.Types;
     this.Initialize(tableInfos);
     this.UserContext.Dispatcher.Invoke(() => this.UserContext.Users.UsersLoggedOut += UserCollection_UsersLoggedOut);
     this.CremaHost.Debug(Resources.Message_TableContextIsCreated);
 }
示例#3
0
 public DataBaseTransaction(Authentication authentication, DataBase dataBase, Guid id)
 {
     this.authentication = authentication;
     this.dataBase       = dataBase;
     this.ID             = id;
     this.dataBase.Dispatcher.VerifyAccess();
     this.repository              = dataBase.Repository;
     this.typeInfos               = dataBase.TypeContext.Types.Select((Type item) => item.TypeInfo).ToArray();
     this.tableInfos              = dataBase.TableContext.Tables.Select((Table item) => item.TableInfo).ToArray();
     this.transactionPath         = this.CremaHost.GetPath(CremaPath.Transactions, $"{dataBase.ID}");
     this.domainPath              = this.CremaHost.GetPath(CremaPath.Domains, $"{dataBase.ID}");
     this.authentication.Expired += Authentication_Expired;
 }