Archived
1
0
This repository has been archived on 2026-04-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FoxTube/FoxTube/Pages/Downloads.xaml.cs
T
Michael Gordeev f637c18e22 Merged PR 17: Version 0.2.181021
- Closed captions fixes
- Merged to YoutubeExplode instead of MyToolkit for video sources
- Video playback fixes
- Internal links support
- Subscription button fixed
- Comments threads fixes and improvements (highlighting author's and user's names)
- General bug fixes
2018-10-20 22:03:04 +00:00

53 lines
1.8 KiB
C#

using FoxTube.Controls;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
#pragma warning disable CS0252 // Possible unintended reference comparison; left hand side needs cast
namespace FoxTube.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class Downloads : Page
{
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
public Downloads()
{
this.InitializeComponent();
path.Text = settings.Values["defaultDownload"] as string;
}
private async void changePath_Click(object sender, RoutedEventArgs e)
{
FolderPicker picker = new FolderPicker()
{
SuggestedStartLocation = PickerLocationId.Downloads,
ViewMode = PickerViewMode.Thumbnail
};
picker.FileTypeFilter.Add(".shit"); //Because overwise it trhows an exception
StorageFolder p = await picker.PickSingleFolderAsync();
if (p != null)
settings.Values["defaultDownload"] = p.Path;
path.Text = settings.Values["defaultDownload"] as string;
}
private async void openFolder_Click(object sender, RoutedEventArgs e)
{
await Launcher.LaunchFolderAsync( await StorageFolder.GetFolderFromPathAsync(settings.Values["defaultDownload"] as string));
}
}
}