Ejemplo n.º 1
0
 private void myWebClient_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
 {
     if ((e.Error != null))
     {
         this.OnHandledException(new HandledExceptionEventArgs(e.Error));
     }
     else
     {
         if ((e.UserState is string))
         {
             string state = e.UserState as string;
             if (state == "check")
             {
                 if ((e.Result != null) && (e.Result.Length > 1))
                 {
                     NewVersionEventArgs myeventarg = null;
                     if ((e.Result.Length == 4))
                     {
                         myeventarg = new NewVersionEventArgs(e.Result[0], e.Result[1], e.Result[2], e.Result[3]);
                     }
                     else
                     {
                         myeventarg = new NewVersionEventArgs(e.Result[0], e.Result[1]);
                     }
                     this.OnCheckVersion(myeventarg);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 protected virtual void OnCheckVersion(NewVersionEventArgs e)
 {
     if ((e.Version.CompareTo(Leayal.AppInfo.AssemblyInfo.Version) == 0))
     {
         this.RaiseEventCheckCompleted();
     }
     else
     {
         this.OnNewVersion(e);
     }
 }
Ejemplo n.º 3
0
        private void AutoUpdater_NewVersion(object sender, NewVersionEventArgs e)
        {
            Version.TryParse(GlobalData.Instance.Configuration?.AcknowledgedVersion, out Version acknowledgedVersion);

            if (acknowledgedVersion == null || acknowledgedVersion < e.NewVersion)
            {
                IsVisible    = true;
                ShortText    = $"New version available: {e.NewVersion}";
                DetailedText = null;
            }

            newVersion = e;
        }
Ejemplo n.º 4
0
 private void OnNewVersion(NewVersionEventArgs e)
 {
     this._IsNewVersion = true;
     this._NewVersion   = e.Version;
     if (FoundNewVersion != null)
     {
         this.syncContext?.Send(new SendOrPostCallback(delegate { this.FoundNewVersion.Invoke(this, e); }), null);
     }
     if (e.AllowUpdate)
     {
         this.OnPreDownloadUpdate(e.Version);
     }
     else
     {
         this._IsBusy = false;
         this.RaiseEventStepChanged(string.Format(LanguageManager.GetMessageText("SelfUpdate_NewVersionFound", "Found newer version: {0}"), e.Version.ToString()));
     }//*/
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Version Checker Handler for version checks.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Envman.VersionManager.NewVersionEventArgs"/> instance containing the event data.</param>
        private void VersionChecker_NewVersionChecked(
            object sender, NewVersionEventArgs e)
        {
            string msg = string.Empty;

            if (e.NewVersion)
            {
                this.versionInfo = e.VersionInformation;
                msg = "New version " + VersionInfo.VersionFormatter(
                    this.versionInfo.AssemblyVersion) + " released";
                this.TsmiNewVersionInfo.Text    = msg;
                this.TsmiNewVersionInfo.Visible = true;

                if (this.showFrmVersionInfo)
                {
                    FrmVersionInfo versionInfoForm = new FrmVersionInfo();
                    versionInfoForm.Icon    = Properties.Resources.EnvManICO;
                    versionInfoForm.Message = msg;
                    if (versionInfoForm.ShowDialog() == DialogResult.OK)
                    {
                        this.TsmiClick(this.TsmiNewVersionInfo, null);
                    }
                }
            }
            else
            {
                msg = "You have the current version.";
                if (this.showFrmVersionInfo)
                {
                    MessageBox.Show(
                        msg,
                        "EnvMan",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Handles the VersionChecked event of the versionChecker control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="SFC.EnvMan.VersionManager.NewVersionEventArgs"/> instance containing the event data.</param>
 private void VersionChecker_VersionChecked(
     object sender, NewVersionEventArgs e)
 {
 }