From 0afcf7eafe24acd9d22eed8678637770ba73f3c3 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Wed, 7 Dec 2022 14:01:12 +0800 Subject: [PATCH] Use auto deconstructor and rename return value --- .../Flow.Launcher.Plugin.Program/AddProgramSource.xaml.cs | 4 +--- .../ViewModels/AddProgramSourceViewModel.cs | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml.cs b/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml.cs index c41e9f688..be8b768bd 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml.cs @@ -29,9 +29,7 @@ namespace Flow.Launcher.Plugin.Program private void BtnAdd_OnClick(object sender, RoutedEventArgs e) { - var status = ViewModel.AddOrUpdate(); - bool modified = status.Item1; - string msg = status.Item2; + var (modified, msg) = ViewModel.AddOrUpdate(); if (modified == false && msg != null) { MessageBox.Show(msg); // Invalid diff --git a/Plugins/Flow.Launcher.Plugin.Program/ViewModels/AddProgramSourceViewModel.cs b/Plugins/Flow.Launcher.Plugin.Program/ViewModels/AddProgramSourceViewModel.cs index b7d1bddbb..ffe9b2dce 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/ViewModels/AddProgramSourceViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/ViewModels/AddProgramSourceViewModel.cs @@ -67,7 +67,7 @@ namespace Flow.Launcher.Plugin.Program.ViewModels } } - public (bool, string) AddProgramSource() + public (bool modified, string message) AddProgramSource() { if (!Directory.Exists(Location)) { @@ -86,7 +86,7 @@ namespace Flow.Launcher.Plugin.Program.ViewModels } } - public (bool, string) UpdateProgramSource() + public (bool modified, string message) UpdateProgramSource() { if (LocationModified) { @@ -110,7 +110,7 @@ namespace Flow.Launcher.Plugin.Program.ViewModels return (StatusModified || LocationModified, null); } - public (bool, string) AddOrUpdate() + public (bool modified, string message) AddOrUpdate() { if (Source == null) {