/// <summary> /// /// </summary> /// <param name="appInfo"></param> public AutoUpdater(IAutoUpdatable appInfo) { applicationInfo = appInfo; bgWorker = new BackgroundWorker(); bgWorker.DoWork += new DoWorkEventHandler(bgWorker_DoWork); bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgWorker_RunWorkerCompleted); }
public AutoUpdater(IAutoUpdatable applicationInfo) { this.applicationInfo = applicationInfo; bgWorker = new BackgroundWorker(); bgWorker.DoWork += BgWorkerOnDoWork; bgWorker.RunWorkerCompleted += BgWorkerOnRunWorkerCompleted; }
public AutoUpdateSharp(IAutoUpdatable AppInfo) { mAppInfo = AppInfo; mBgWorker = new BackgroundWorker(); mBgWorker.DoWork += new DoWorkEventHandler(mBgWorker_DoWork); mBgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(mBgWorker_RunWorkerCompleted); }
void BgWorkerOnDoWork(object sender, DoWorkEventArgs e) { IAutoUpdatable application = (IAutoUpdatable)e.Argument; if (!AutoUpdateXML.ExistOnServer(application.UpdateXmmlLocation)) { e.Cancel = true; } else { e.Result = AutoUpdateXML.Parse(application.UpdateXmmlLocation, application.ApplicationID); } }
/// <summary> /// /// </summary> /// <param name="applicationInfo"></param> /// <param name="update"></param> internal AutoUpdateAcceptForm(IAutoUpdatable applicationInfo, AutoUpdateXml update) { InitializeComponent(); this.applicationInfo = applicationInfo; this.update = update; Text = applicationInfo.ApplicationName + " Update Available"; if (applicationInfo.ApplicationIcon != null) { Icon = applicationInfo.ApplicationIcon; } lblNewVersion.Text = String.Format("New Version: {0}", update.Version.ToString()); }
/// <summary> /// Checks for/parses update.xml on the server. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { IAutoUpdatable appInfo = (IAutoUpdatable)e.Argument; if (!AutoUpdateXml.ExistsOnServer(appInfo.UpdateXmlLocation)) { e.Cancel = true; } else { e.Result = AutoUpdateXml.Parse(appInfo.UpdateXmlLocation, appInfo.ApplicationId); } }
internal AutoUpdateInfoForm(IAutoUpdatable applicationInfo, AutoUpdateXML updateInfo) { InitializeComponent(); if (applicationInfo.ApplicationIcon != null) { this.Icon = applicationInfo.ApplicationIcon; } this.Text = applicationInfo.ApplicationName + " - Update Info"; this.labelVersions.Text = $"Current Version: {applicationInfo.ApplicationAssembly.GetName().Version} \n" + $"Update Version: {updateInfo.Version}"; this.textDescription.Text = updateInfo.Description; }
/// <summary> /// Creates a new InfoForm. /// </summary> /// <param name="applicationInfo"></param> /// <param name="updateInfo"></param> internal InfoForm(IAutoUpdatable applicationInfo, AutoUpdateXml updateInfo) { InitializeComponent(); //Sets the icon if it's not null if (applicationInfo.ApplicationIcon != null) { Icon = applicationInfo.ApplicationIcon; } //Fill the UI Text = applicationInfo.ApplicationName + " Update Info"; lblVersions.Text = String.Format("Current Version: {0}\nUpdate Version: {1}", applicationInfo.ApplicationAssembly.GetName().Version.ToString(), updateInfo.Version.ToString()); txtDescription.Text = updateInfo.Description; }
internal AutoUpdateAcceptForm(IAutoUpdatable applicationInfo, AutoUpdateXML updateInfo) { InitializeComponent(); this.applicationInfo = applicationInfo; this.updateInfo = updateInfo; this.Text = this.applicationInfo.ApplicationName + " - Update Available"; if (this.applicationInfo.ApplicationIcon != null) { this.Icon = this.applicationInfo.ApplicationIcon; } this.labelNewVersion.Text = $"New Version: {this.updateInfo.Version}"; }