示例#1
0
 public Library(IRemovableDriveWatcher driveWatcher)
 {
     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.disposeLock = new object();
 }
示例#2
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;
 }
示例#3
0
        public Library(IRemovableDriveWatcher driveWatcher)
        {
            if (CoreSettings.Default.UpgradeRequired)
            {
                CoreSettings.Default.Upgrade();
                CoreSettings.Default.UpgradeRequired = false;
            }

            this.songLock = new object();
            this.songs = new HashSet<Song>();
            this.playlists = new List<Playlist>();
            this.volume = 1.0f;
            this.AccessMode = AccessMode.Administrator; // We want implicit to be the administrator, till we change to user mode manually
            this.driveWatcher = driveWatcher;
            this.driveWatcher.DriveRemoved += (sender, args) => Task.Factory.StartNew(this.Update);
            this.cacheResetHandle = new AutoResetEvent(false);
            this.disposeLock = new object();
        }