private void updater_PNNewVersionFound(object sender, NewVersionFoundEventArgs e)
 {
     try
     {
         var updater = sender as PNUpdateChecker;
         if (updater != null)
         {
             updater.NewVersionFound -= updater_PNNewVersionFound;
         }
         var message =
             PNLang.Instance.GetMessageText("new_version_1",
                                            "New version of PNotes.NET is available - %PLACEHOLDER1%.")
                   .Replace(PNStrings.PLACEHOLDER1, e.Version);
         message += "\n";
         message += PNLang.Instance.GetMessageText("new_version_2", "Click 'OK' in order to instal new version (restart of program is required).");
         if (
             PNMessageBox.Show(message, PNStrings.PROG_NAME, MessageBoxButton.OKCancel, MessageBoxImage.Information) !=
             MessageBoxResult.OK) return;
         if (PNStatic.PrepareNewVersionCommandLine())
         {
             PNStatic.FormMain.Close();
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Beispiel #2
0
 private void updater_PNNewVersionFound(object sender, NewVersionFoundEventArgs e)
 {
     try
     {
         var text = PNLang.Instance.GetMessageText("new_version_1",
             "New version of PNotes.NET is available - %PLACEHOLDER1%.")
             .Replace(PNStrings.PLACEHOLDER1, e.Version);
         var link = PNLang.Instance.GetMessageText("new_version_3",
             "Click here in order to instal new version (restart of program is required).");
         var baloon = new Baloon(BaloonMode.NewVersion) { BaloonText = text, BaloonLink = link };
         baloon.BaloonLinkClicked += baloon_BaloonLinkClicked;
         ntfPN.ShowCustomBalloon(baloon, PopupAnimation.Slide, 10000);
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }