Пример #1
0
        protected virtual void OnNewerVersionFound(NewerVersionFoundEventArgs e)
        {
            var handler = NewerVersionFound;

            if (handler != null)
            {
                handler(this, e);
            }
        }
 protected virtual void OnNewerVersionFound (NewerVersionFoundEventArgs e)
 {
   var handler = NewerVersionFound;
   if (handler != null)
     handler (this, e);
 }
    private void ShowGetNewVersionForm (NewerVersionFoundEventArgs e)
    {
      try
      {
        var form = new GetNewVersionForm (e.WhatsNewInformation, e.NewVersion, e.DownloadLink);
        form.TurnOffCheckForNewerVersions += delegate
        {
          ShouldCheckForNewerVersions = false;
          MessageBox.Show ("Automatic check for newer version turned off.", "CalDav Synchronizer");
        };

        form.IgnoreThisVersion += delegate
        {
          _optionsDataAccess.IgnoreUpdatesTilVersion = e.NewVersion;
          MessageBox.Show (string.Format ("Waiting for newer version than '{0}'.", e.NewVersion), "CalDav Synchronizer");
        };

        form.ShowDialog();
      }
      catch (Exception x)
      {
        ExceptionHandler.Instance.LogException (x, s_logger);
      }
    }
 private void UpdateChecker_NewerVersionFound (object sender, NewerVersionFoundEventArgs e)
 {
   EnsureSynchronizationContext();
   SynchronizationContext.Current.Send (_ => ShowGetNewVersionForm (e), null);
 }
 private void ShowGetNewVersionForm (NewerVersionFoundEventArgs e)
 {
   try
   {
     var form = new GetNewVersionForm (e.WhatsNewInformation, e.NewVersion, e.DownloadLink);
     form.TurnOffCheckForNewerVersions += delegate
     {
       ShouldCheckForNewerVersions = false;
       MessageBox.Show ("Automatic check for newer version turned off.", "CalDav Synchronizer");
     };
     form.ShowDialog();
   }
   catch (Exception x)
   {
     ExceptionHandler.Instance.LogException (x, s_logger);
   }
 }