示例#1
0
        public async Task <Library> LoadLibrary()
        {
            string         libraryPath  = (string)ApplicationData.Current.LocalSettings.Values[LocalSettingLibraryPathKey];
            StorageLibrary musicLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Music);

            StorageFolder libraryRoot = musicLibrary.Folders.FirstOrDefault(f => f.Path.Equals(libraryPath));

            if (libraryRoot == null)
            {
                throw new InvalidOperationException("Couldn't find the user collection in the system music library");
            }

            Library library = await Library.LoadAsync(libraryRoot);

            CurrentLibrary = library;
            LibraryLoaded?.Invoke(library);

            return(library);
        }
示例#2
0
 protected virtual void OnLibraryLoaded(DebuggeeLibraryEventArgs e)
 {
     LibraryLoaded?.Invoke(this, e);
 }