Пример #1
0
 public AlbumTracksStore(
     [FromServices] Dbc dbc,
     [FromServices] Library library,
     [FromServices] Playback playback,
     [FromServices] TrackStore trackStore,
     [FromServices] AlbumStore albumStore
     ) : base(dbc)
 {
     this._library    = library;
     this._playback   = playback;
     this._trackStore = trackStore;
     this._albumStore = albumStore;
 }
Пример #2
0
 protected override void Dispose(bool disposing)
 {
     if (!this.IsDisposed && disposing)
     {
         this._library  = null;
         this._playback = null;
         this._trackStore.Dispose();
         this._trackStore = null;
         this._albumStore.Dispose();
         this._albumStore = null;
     }
     base.Dispose(disposing);
 }
Пример #3
0
        public DbMaintainer(
            [FromServices] Dbc dbc,
            [FromServices] GenreStore genreStore,
            [FromServices] ArtistStore artistStore,
            [FromServices] AlbumStore albumStore,
            [FromServices] ArtistAlbumStore artistAlbumStore,
            [FromServices] GenreAlbumStore genreAlbumStore,
            [FromServices] GenreArtistStore genreArtistStore
        )
        {
            this._dbc = dbc;
            this._genreStore = genreStore;
            this._artistStore = artistStore;
            this._albumStore = albumStore;
            this._artistAlbumStore = artistAlbumStore;
            this._genreAlbumStore = genreAlbumStore;
            this._genreArtistStore = genreArtistStore;

            DbMaintainer._instance = this;
        }
Пример #4
0
        private bool _isDisposed = false; // 重複する呼び出しを検出するには

        protected virtual void Dispose(bool disposing)
        {
            if (!this._isDisposed)
            {
                if (disposing)
                {
                    if (
                        this._albumScannerCanceler != null
                        || this._dbUpdaterCanceler != null
                    )
                    {
                        this.StopAllTasks()
                            .GetAwaiter()
                            .GetResult();
                    }

                    this._genreStore.Dispose();
                    this._albumStore.Dispose();
                    this._artistStore.Dispose();
                    this._artistAlbumStore.Dispose();
                    this._genreAlbumStore.Dispose();
                    this._genreArtistStore.Dispose();
                    this._dbc.Dispose();
                    this._updaters?.Clear();

                    this._genreStore = null;
                    this._albumStore = null;
                    this._artistStore = null;
                    this._artistAlbumStore = null;
                    this._genreAlbumStore = null;
                    this._genreArtistStore = null;
                    this._dbc = null;
                    this._updaters = null;
                    this._message = null;
                }

                this._isDisposed = true;
            }
        }