Exemple #1
0
 protected DbCommands(MediaDatabaseContext existingContext = null)
 {
     if (existingContext == null)
     {
         Db = new MediaDatabaseContext();
         UsingExistingContext = false;
     }
     else
     {
         Db = existingContext;
         UsingExistingContext = true;
     }
 }
        void createDatabase()
        {
            // database location ("username"/appdata/local/MediaViewer) mapped to |Datalocation| in App.config
            String databaseLocation = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "MediaViewer");

            AppDomain.CurrentDomain.SetData("DataDirectory", databaseLocation);

            bool exists = System.IO.Directory.Exists(databaseLocation);

            if (!exists)
            {
                System.IO.Directory.CreateDirectory(databaseLocation);
                var context = new MediaDatabaseContext();
                context.Database.Create();
            }
        }
 public PresetMetadataDbCommands(MediaDatabaseContext existingContext = null) : base(existingContext)
 {
 }
Exemple #4
0
 public TagDbCommands(MediaDatabaseContext existingContext = null) :
     base(existingContext)
 {
 }