This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tobiichiamane
committed
Sep 20, 2019
1 parent
2a9941c
commit 8764d52
Showing
3 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
using System; | ||
using Microsoft.Toolkit.Uwp.Helpers; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.ApplicationModel; | ||
using Windows.ApplicationModel.DataTransfer; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.System; | ||
using Windows.UI.Popups; | ||
using Windows.UI.ViewManagement; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
|
@@ -25,6 +31,52 @@ public sealed partial class ReportIssuePage : Page | |
public ReportIssuePage() | ||
{ | ||
this.InitializeComponent(); | ||
Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; | ||
if (localSettings.Values["exception"] == null) | ||
{ | ||
Frame.Navigate(typeof(LoginPage)); | ||
return; | ||
} | ||
var lastExeption = (string)localSettings.Values["exception"]; | ||
var view = ApplicationView.GetForCurrentView(); | ||
view.Title = "Crash Report/崩溃报告"; | ||
txtDetails.Text += "General:\n"; | ||
txtDetails.Text += string.Format("OS version: build {0}\n", SystemInformation.OperatingSystemVersion.Build); | ||
txtDetails.Text += string.Format("App version: {0}.{1}.{2} {3}\n", | ||
Package.Current.Id.Version.Major, | ||
Package.Current.Id.Version.Minor, | ||
Package.Current.Id.Version.Build, | ||
Package.Current.Id.Architecture); | ||
txtDetails.Text += string.Format("Package ID: {0}\n\n", Package.Current.Id.Name); | ||
txtDetails.Text += "Exception:\n"; | ||
txtDetails.Text += lastExeption; | ||
} | ||
|
||
private void BtnContinue_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Frame.Navigate(typeof(LoginPage)); | ||
} | ||
|
||
private async void BtnCopy_Click(object sender, RoutedEventArgs e) | ||
{ | ||
DataPackage dataPackage = new DataPackage(); | ||
dataPackage.RequestedOperation = DataPackageOperation.Copy; | ||
dataPackage.SetText(txtDetails.Text); | ||
Clipboard.SetContent(dataPackage); | ||
MessageDialog dialog = new MessageDialog("Valuable information has been copied to clipboard./有价值的信息已经被复制到剪贴板。", "Copied/已复制"); | ||
await dialog.ShowAsync(); | ||
} | ||
|
||
private async void BtnGitHub_Click(object sender, RoutedEventArgs e) | ||
{ | ||
await Launcher.LaunchUriAsync(new | ||
Uri(@"https://github.com/tobiichiamane/pixivfs-uwp/issues/new")); | ||
} | ||
|
||
private async void BtnEmail_Click(object sender, RoutedEventArgs e) | ||
{ | ||
await Launcher.LaunchUriAsync(new | ||
Uri(@"mailto:[email protected]")); | ||
} | ||
} | ||
} |