Esempio n. 1
0
        public void AddToDatabase(Database.CustomDbContext db)
        {
            if (db == null)
            {
                return;
            }

            if (!InDatabase)
            {
                InDatabase = true;

                if (Show != null)
                {
                    Show.AddToDatabase(db);
                }

                foreach (FavEpisodeData episode in Episodes)
                {
                    episode.AddToDatabase(db);
                }

                foreach (DownloadData nonEpisode in NonEpisodes)
                {
                    nonEpisode.AddToDatabase(db);
                }

                Database.DatabaseWriter.AddToDatabase <FavSeasonData>(db.FavSeasonData, this);
            }
        }
Esempio n. 2
0
        public void AddToDatabase(Database.CustomDbContext db)
        {
            if (db == null)
            {
                return;
            }

            _mutexDelete.WaitOne();

            if (!_isDeleted)
            {
                if (!InDatabase)
                {
                    InDatabase = true;

                    if (Show != null)
                    {
                        Show.AddToDatabase(db);
                    }

                    foreach (FavSeasonData season in Seasons)
                    {
                        season.AddToDatabase(db);
                    }

                    foreach (DownloadData nonSeason in NonSeasons)
                    {
                        nonSeason.AddToDatabase(db);
                    }

                    Database.DatabaseWriter.AddToDatabase <FavShowData>(db.FavShowData, this);
                }
            }

            _mutexDelete.ReleaseMutex();
        }