Use auto deconstructor and rename return value

This commit is contained in:
Vic 2022-12-07 14:01:12 +08:00
parent e720e4facd
commit 0afcf7eafe
2 changed files with 4 additions and 6 deletions

View file

@ -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

View file

@ -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)
{