public static void Show(IUpdatetable applicationInfo, string title, string message, MessageBoxInfoType type) { MessageBoxUpdater messagebox = new MessageBoxUpdater(title, message, type); messagebox.Owner = applicationInfo.Context; messagebox.ShowDialog(); }
public MainUpdater(IUpdatetable applicationInfo) { this.applicationInfo = applicationInfo; backgrounWorker = new BackgroundWorker(); backgrounWorker.DoWork += BackgrounWorker_DoWork; backgrounWorker.RunWorkerCompleted += BackgrounWorker_RunWorkerCompleted; }
public UpdateInfo(IUpdatetable applicationInfo, UpdateXml updateInfo) { InitializeComponent(); if (applicationInfo.ApplicationIcon != null) { this.Icon = applicationInfo.ApplicationIcon; } this.Title = applicationInfo.ApplicationName + " - Информация по обновлению"; this.currentVersion_lb.Text = string.Format("Текущая версия: {0}", applicationInfo.ApplicationAssemby.GetName().Version.ToString()); this.latestVersion_lb.Text = string.Format("Новая версия: {0}", updateInfo.Version.ToString()); this.description_tb.Text = updateInfo.Description; }
private void BackgrounWorker_DoWork(object sender, DoWorkEventArgs e) { IUpdatetable applicationInfo = (IUpdatetable)e.Argument; if (!UpdateXml.ExistsOnServer(applicationInfo.UpdateXmlLocation)) { e.Cancel = true; UpdateMessageBox.Show(applicationInfo, "Проверка обновления", "Обновления отсутствуют", MessageBoxInfoType.Info); } else { e.Result = UpdateXml.Parse(applicationInfo.UpdateXmlLocation, applicationInfo.ApplicationID); } }
public UpdateAccept(IUpdatetable applicationInfo, UpdateXml updateInfo) { InitializeComponent(); this.applicationInfo = applicationInfo; this.updateInfo = updateInfo; this.Title = this.applicationInfo.ApplicationName + " - Обновление доступно"; if (this.applicationInfo.ApplicationIcon != null) { this.Icon = this.applicationInfo.ApplicationIcon; } newversion_tb.Text = string.Format("Новая версия: {0}", this.updateInfo.Version.ToString()); }