/// <summary> /// Version Checker Handler for version checks. /// </summary> /// <param name="newVersion">if set to <c>true</c> [new version].</param> /// <param name="versionInfo">The version info.</param> void versionChecker_NewVersionChecked(bool newVersion, VersionInfo versionInfo) { string msg = string.Empty; if (newVersion) { msg = "New version " + VersionInfo.VersionFormatter(versionInfo.AssemblyVersion) + " released"; tsmiNewVersionInfo.Text = msg; tsmiNewVersionInfo.Visible = true; this.versionInfo = versionInfo; if (showFrmVersionInfo) { FrmVersionInfo versionInfoForm = new FrmVersionInfo(); versionInfoForm.Icon = Properties.Resources.EnvManICO; versionInfoForm.Message = msg; if (versionInfoForm.ShowDialog() == DialogResult.OK) { TsmiClick(tsmiNewVersionInfo, null); } } } else { msg = "You have the current version."; if (showFrmVersionInfo) { MessageBox.Show(msg, "EnvMan", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void ShowCurrentVersion() { string strError = string.Empty; AppVersionInfo av = new AppVersionInfo(); av.AppVersion = Common_Var.AppVersion; av.AppName = Common_Var.SolutionName + ".exe"; if (!Login_Func.GetAppVersionByVersion(ref av, ref strError)) { MessageBox.Show(strError); return; } using (FrmVersionInfo frm = new FrmVersionInfo(av, false)) { frm.ShowDialog(); } }
/// <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); } } }