Exemplo n.º 1
0
        public static Library CreateLibraryWithPlaylist(string playlistName = "Playlist", ILibrarySettings settings = null)
        {
            var library = CreateLibrary(settings);
            library.AddAndSwitchToPlaylist(playlistName);

            return library;
        }
Exemplo n.º 2
0
 public static Library CreateLibrary(ILibrarySettings settings = null)
 {
     return(new Library(
                new Mock <IRemovableDriveWatcher>().Object,
                new Mock <ILibraryReader>().Object,
                new Mock <ILibraryWriter>().Object,
                settings ?? new Mock <ILibrarySettings>().SetupAllProperties().Object));
 }
Exemplo n.º 3
0
 public static Library CreateLibrary(ILibrarySettings settings = null)
 {
     return new Library(
         new Mock<IRemovableDriveWatcher>().Object,
         new Mock<ILibraryReader>().Object,
         new Mock<ILibraryWriter>().Object,
         settings ?? new Mock<ILibrarySettings>().SetupAllProperties().Object);
 }
Exemplo n.º 4
0
 public Library(IRemovableDriveWatcher driveWatcher, ILibraryReader libraryReader, ILibraryWriter libraryWriter, ILibrarySettings settings)
 {
     this.songLock = new object();
     this.songs = new HashSet<Song>();
     this.playlists = new List<Playlist>();
     this.AccessMode = AccessMode.Administrator; // We want implicit to be the administrator, till we change to user mode manually
     this.cacheResetHandle = new AutoResetEvent(false);
     this.driveWatcher = driveWatcher;
     this.libraryReader = libraryReader;
     this.libraryWriter = libraryWriter;
     this.disposeLock = new object();
     this.settings = settings;
 }
Exemplo n.º 5
0
 public Library(IRemovableDriveWatcher driveWatcher, ILibraryReader libraryReader, ILibraryWriter libraryWriter, ILibrarySettings settings)
 {
     this.songLock         = new object();
     this.songs            = new HashSet <Song>();
     this.playlists        = new List <Playlist>();
     this.AccessMode       = AccessMode.Administrator; // We want implicit to be the administrator, till we change to user mode manually
     this.cacheResetHandle = new AutoResetEvent(false);
     this.driveWatcher     = driveWatcher;
     this.libraryReader    = libraryReader;
     this.libraryWriter    = libraryWriter;
     this.disposeLock      = new object();
     this.settings         = settings;
 }
Exemplo n.º 6
0
        public static Library CreateLibraryWithPlaylist(string playlistName = "Playlist", ILibrarySettings settings = null)
        {
            var library = CreateLibrary(settings);

            library.AddAndSwitchToPlaylist(playlistName);

            return(library);
        }