Skip to content

Commit

Permalink
Await some Sparkle StartLoop calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadpikle committed Aug 13, 2024
1 parent 3148a88 commit d8dab0d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
10 changes: 8 additions & 2 deletions src/NetSparkle.Samples.Avalonia.MacOS/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using NetSparkleUpdater.Enums;
using NetSparkleUpdater.SignatureVerifiers;
using System.IO;
using System.Threading.Tasks;

namespace NetSparkleUpdater.Samples.Avalonia
{
Expand All @@ -26,10 +27,15 @@ public MainWindow()
};
// TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
_sparkle.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;
_sparkle.StartLoop(true, true);
StartSparkle();
}

public async void ManualUpdateCheck_Click(object sender, RoutedEventArgs e)
private async void StartSparkle()
{
await _sparkle.StartLoop(true, true);
}

public async Task ManualUpdateCheck_Click(object sender, RoutedEventArgs e)
{
await _sparkle.CheckForUpdatesAtUserRequest();
}
Expand Down
7 changes: 6 additions & 1 deletion src/NetSparkle.Samples.Avalonia.MacOSZip/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ public MainWindow()
};
// TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
_sparkle.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;
_sparkle.StartLoop(true, true);
StartSparkle();
}

private async void StartSparkle()
{
await _sparkle.StartLoop(true, true);
}

public async void ManualUpdateCheck_Click(object sender, RoutedEventArgs e)
Expand Down
10 changes: 8 additions & 2 deletions src/NetSparkle.Samples.Avalonia/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NetSparkleUpdater.SignatureVerifiers;
using NetSparkleUpdater.UI.Avalonia;
using System.IO;
using System.Threading.Tasks;

namespace NetSparkleUpdater.Samples.Avalonia
{
Expand All @@ -30,10 +31,15 @@ public MainWindow()
};
// TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
_sparkle.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;
_sparkle.StartLoop(true, true);
StartSparkle();
}

public async void ManualUpdateCheck_Click()
private async void StartSparkle()
{
await _sparkle.StartLoop(true, true);
}

public async Task ManualUpdateCheck_Click()
{
await _sparkle.CheckForUpdatesAtUserRequest();
}
Expand Down
7 changes: 6 additions & 1 deletion src/NetSparkle.Samples.NetCore.WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ public MainWindow()
};
// TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
_sparkle.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;
_sparkle.StartLoop(true, true);
StartSparkle();
}

private async void StartSparkle()
{
await _sparkle.StartLoop(true, true);
}

private async void ManualUpdateCheck_Click(object sender, RoutedEventArgs e)
Expand Down
11 changes: 8 additions & 3 deletions src/NetSparkle.Samples.NetCore.WinForms/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ public Form1()
// TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
_sparkleUpdateDetector.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;
//_sparkleUpdateDetector.CloseApplication += _sparkleUpdateDetector_CloseApplication;
_sparkleUpdateDetector.StartLoop(true, true);
StartSparkle();
}

private async void StartSparkle()
{
await _sparkleUpdateDetector.StartLoop(true, true);
}

private void _sparkleUpdateDetector_CloseApplication()
Expand All @@ -50,9 +55,9 @@ private async void AppBackgroundCheckButton_Click(object sender, EventArgs e)
}
}

private void ExplicitUserRequestCheckButton_Click(object sender, EventArgs e)
private async void ExplicitUserRequestCheckButton_Click(object sender, EventArgs e)
{
_sparkleUpdateDetector.CheckForUpdatesAtUserRequest();
await _sparkleUpdateDetector.CheckForUpdatesAtUserRequest();
}
}
}

0 comments on commit d8dab0d

Please sign in to comment.