コード例 #1
0
        private async Task AddBookFromFileAsync(IStorageFile file)
        {
            var dialog          = new BusyIndicator();
            var taskDescription = _resourceLoader.GetString("Application_Opening");

            dialog.TaskDescription = string.Format(taskDescription, file.Name);
            dialog.Show();

            try
            {
                await _bookProvider.AddBookAsync(file);
            }
            catch (NotImplementedException)
            {
                await ShowDocumentTypeIsNotSupportedMessageAsync();
            }
            catch
            {
                await ShowDocumentOpeningErrorMessageAsync();
            }
            finally
            {
                dialog.Hide();
            }
        }