From 5bce4b52ffcfc697ceac007556de051b280e8513 Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Sun, 5 Apr 2020 00:31:01 +0300 Subject: [PATCH] [GUI] Add a link to project's wiki Closes #284 --- .../Commands/GuideCommand.cs | 2 +- DiscordChatExporter.Gui/Internal/ProcessEx.cs | 18 ++++++++++++++++++ DiscordChatExporter.Gui/Views/RootView.xaml | 8 ++++++++ DiscordChatExporter.Gui/Views/RootView.xaml.cs | 11 ++++++++++- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 DiscordChatExporter.Gui/Internal/ProcessEx.cs diff --git a/DiscordChatExporter.Cli/Commands/GuideCommand.cs b/DiscordChatExporter.Cli/Commands/GuideCommand.cs index 658b4e5..78d2481 100644 --- a/DiscordChatExporter.Cli/Commands/GuideCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GuideCommand.cs @@ -44,7 +44,7 @@ namespace DiscordChatExporter.Cli.Commands console.Output.WriteLine(" 6. Copy the first long sequence of numbers inside the URL"); console.Output.WriteLine(); - console.Output.WriteLine("If you still have unanswered questions, check out the wiki:"); + console.Output.WriteLine("For more information, check out the wiki:"); console.Output.WriteLine("https://github.com/Tyrrrz/DiscordChatExporter/wiki"); return default; diff --git a/DiscordChatExporter.Gui/Internal/ProcessEx.cs b/DiscordChatExporter.Gui/Internal/ProcessEx.cs new file mode 100644 index 0000000..7481b42 --- /dev/null +++ b/DiscordChatExporter.Gui/Internal/ProcessEx.cs @@ -0,0 +1,18 @@ +using System.Diagnostics; + +namespace DiscordChatExporter.Gui.Internal +{ + internal static class ProcessEx + { + public static void StartShellExecute(string path) + { + var startInfo = new ProcessStartInfo(path) + { + UseShellExecute = true + }; + + using (Process.Start(startInfo)) + { } + } + } +} \ No newline at end of file diff --git a/DiscordChatExporter.Gui/Views/RootView.xaml b/DiscordChatExporter.Gui/Views/RootView.xaml index 432e141..eddfffe 100644 --- a/DiscordChatExporter.Gui/Views/RootView.xaml +++ b/DiscordChatExporter.Gui/Views/RootView.xaml @@ -167,6 +167,10 @@ + + + wiki + @@ -192,6 +196,10 @@ + + + wiki + diff --git a/DiscordChatExporter.Gui/Views/RootView.xaml.cs b/DiscordChatExporter.Gui/Views/RootView.xaml.cs index f9a00a9..c353481 100644 --- a/DiscordChatExporter.Gui/Views/RootView.xaml.cs +++ b/DiscordChatExporter.Gui/Views/RootView.xaml.cs @@ -1,4 +1,7 @@ -namespace DiscordChatExporter.Gui.Views +using System.Windows.Navigation; +using DiscordChatExporter.Gui.Internal; + +namespace DiscordChatExporter.Gui.Views { public partial class RootView { @@ -6,5 +9,11 @@ { InitializeComponent(); } + + private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e) + { + ProcessEx.StartShellExecute(e.Uri.AbsoluteUri); + e.Handled = true; + } } } \ No newline at end of file