Exemple #1
0
        private async void ExportAllButton_Click(object sender, RoutedEventArgs e)
        {
            String Token = await StorageInterface.PickExternalStorageFolder();

            StorageFolder target = await StorageInterface.GetStorageFolderFromToken(Token);

            target = await target.CreateFolderAsync(SourceFolder.Name, CreationCollisionOption.OpenIfExists);

            if (MultiSelect)
            {
                for (int i = 0; i < Files.Length; i++)
                {
                    if (SelectItems[i].IsChecked == true)
                    {
                        await Files[i].CopyAsync(target, Files[i].Name, NameCollisionOption.ReplaceExisting);
                    }
                }
                for (int i = 0; i < Folders.Length; i++)
                {
                    if (FSelect[i].IsChecked == true)
                    {
                        await Folders[i].CopyFolderContentsTo(await target.CreateFolderAsync(Folders[i].Name, CreationCollisionOption.GenerateUniqueName));
                    }
                }
            }
            else
            {
                await SourceFolder.CopyFolderContentsTo(target);
            }
            DeactivateMultiSelect();
        }
Exemple #2
0
        private async void SelectFolderButton_Click(object sender, RoutedEventArgs e)
        {
            i = 0;
            bool x = halted;

            halted = true;
            arr    = await(await StorageInterface.GetStorageFolderFromToken(await StorageInterface.PickExternalStorageFolder())).GetStorageFileArray();
            Show();
            PauseButton.IsEnabled = true;
            halted = x;
        }
Exemple #3
0
        private async void FolderSave_Click(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < Folders.Length; i++)
            {
                if (sender == FSave[i])
                {
                    String Token = await StorageInterface.PickExternalStorageFolder();

                    await Folders[i].CopyFolderContentsTo(await(await StorageInterface.GetStorageFolderFromToken(Token)).CreateFolderAsync(Folders[i].Name, CreationCollisionOption.GenerateUniqueName));
                    //await Files[i].CopyAndReplaceAsync(await StorageInterface.GetStorageFileFromToken(Token));
                }
            }
        }
Exemple #4
0
        private async void Download()
        {
            String Token = await StorageInterface.ReadFromLocalFolder("Storage.Garfield.token");

            if (Token == null || Token.Equals(""))
            {
                await UserInteraction.ShowDialogAsync("INFORMATION", "You will now be prompted to chose a Folder in which to save the Comic. This App will create a new Folder within the Folder you selected, called \"Garfield\", which will be used to store the images (in order not to confuse them with your files). The App will remember the location you have picked and will use this location until you change it in the Settings.");

                Token = await StorageInterface.PickExternalStorageFolder();

                await StorageInterface.WriteToLocalFolder("Storage.Garfield.token", Token);
            }
            try
            {
                await StorageInterface.WriteBytesToKnownFolder("Garfield/Garfield_" + date.ToString("yyyy_MM_dd") + ".gif", await NetworkInterface.DownloadGarfield(date), Token);
            }
            catch (Exception e)
            {
                e.PrintStackTrace();
                UserInteraction.ShowToast("ERROR! Could not save file.", "Garfield");
                return;
            }
            UserInteraction.ShowToast("Comic has successfully been saved", "Garfield");
        }