コード例 #1
0
ファイル: Engines.cs プロジェクト: stellar1/PlayoutAutomation
 public Engines(string connectionStringPrimary, string connectionStringSecondary)
 {
     ConnectionStringPrimary   = connectionStringPrimary;
     ConnectionStringSecondary = connectionStringSecondary;
     _db = DatabaseProviderLoader.LoadDatabaseProvider();
     _db.Open(connectionStringPrimary, connectionStringSecondary);
     ArchiveDirectories = new ArchiveDirectories(_db);
     try
     {
         _db.Open();
         EngineList = _db.DbLoadEngines <Engine>();
         Servers    = _db.DbLoadServers <CasparServer>();
         Servers.ForEach(s =>
         {
             s.Channels.ForEach(c => c.Owner  = s);
             s.Recorders.ForEach(r => r.Owner = s);
         });
         EngineList.ForEach(e =>
         {
             e.IsNew              = false;
             e.Servers            = Servers;
             e.ArchiveDirectories = ArchiveDirectories;
         });
     }
     finally
     {
         _db.Close();
     }
 }
コード例 #2
0
 public Engines(string connectionStringPrimary, string connectionStringSecondary)
 {
     ConnectionStringPrimary   = connectionStringPrimary;
     ConnectionStringSecondary = connectionStringSecondary;
     ArchiveDirectories        = new ArchiveDirectories(connectionStringPrimary, connectionStringSecondary);
     try
     {
         Database.Open();
         _engines = Database.DbLoadEngines <Engine>();
         Servers  = Database.DbLoadServers <CasparServer>();
         Servers.ForEach(s =>
         {
             s.Channels.ForEach(c => c.Owner  = s);
             s.Recorders.ForEach(r => r.Owner = s);
         });
         _engines.ForEach(e =>
         {
             e.IsNew              = false;
             e.Servers            = this.Servers;
             e.ArchiveDirectories = this.ArchiveDirectories;
         });
     }
     finally
     {
         Database.Close();
     }
 }
コード例 #3
0
 public Engines(DatabaseType databaseType, ConnectionStringSettingsCollection connectionStringSettingsCollection)
 {
     _db = DatabaseLoader.LoadDatabaseProviders().FirstOrDefault(db => db.DatabaseType == databaseType);
     _db.Open(connectionStringSettingsCollection);
     ArchiveDirectories = new ArchiveDirectories(_db);
     EngineList         = _db.LoadEngines <Engine>().ToList();
     Servers            = _db.LoadServers <CasparServer>();
     foreach (var s in Servers)
     {
         s.Channels.ForEach(c => c.Owner  = s);
         s.Recorders.ForEach(r => r.Owner = s);
     }
     foreach (var e in EngineList)
     {
         e.IsNew              = false;
         e.Servers            = Servers;
         e.ArchiveDirectories = ArchiveDirectories;
     }
 }
コード例 #4
0
 public ArchiveDirectoriesViewmodel(Model.ArchiveDirectories directories) : base(directories, new ArchiveDirectoriesView(), "Archive directories")
 {
     _directories = new ObservableCollection <ArchiveDirectory>(Model.Directories);
     _createCommands();
 }