private void OnUpdateDownloaded(UpdateDownloadedEventArgs e) { if (UpdateDownloaded != null) { UpdateDownloaded(this, e); } }
private void DisplayVersionInformation(UpdateDownloadedEventArgs e) { UpdateManager manager = UpdateManager.Instance; string version = manager.ProductVersion.ToString(); #if (DEBUG) this.VersionNumber.Text = string.Format("Version: {0} (Debug)", version); #else this.VersionNumber.Text = string.Format("Version: {0}", version); #endif if ((null != e) && e.UpdateAvailable) { string latest = manager.AvailableVersion.ToString(); this.UpdateInfo.Foreground = Brushes.OrangeRed; this.UpdateInfo.Text = string.Format("(Latest vesion: {0})", latest); this.UpdateInfo.Cursor = Cursors.Hand; this.UpdateInfo.MouseUp += new MouseButtonEventHandler(OnUpdateInfoMouseUp); } else { this.UpdateInfo.Foreground = Brushes.Green; this.UpdateInfo.Text = "(Up-to-date)"; this.UpdateInfo.Cursor = Cursors.Arrow; this.UpdateInfo.MouseUp -= new MouseButtonEventHandler(OnUpdateInfoMouseUp); } }
private void DisplayVersionInformation(UpdateDownloadedEventArgs e) { if ((null != e) && e.UpdateAvailable) { this.UpdateInfo.Cursor = Cursors.Hand; this.UpdateInfo.MouseUp += new MouseButtonEventHandler(OnUpdateInfoMouseUp); } else { this.UpdateInfo.Cursor = Cursors.Arrow; this.UpdateInfo.MouseUp -= new MouseButtonEventHandler(OnUpdateInfoMouseUp); } }
public void UpdateDownloadedEventArgsConstructorTest() { Exception e = new Exception("Error"); string fileLocation = "FileLocation"; var eventArgs = new UpdateDownloadedEventArgs(e, fileLocation); Assert.AreEqual(e, eventArgs.Error); Assert.AreEqual(fileLocation, eventArgs.UpdateFileLocation); Assert.IsTrue(eventArgs.UpdateAvailable); eventArgs = new UpdateDownloadedEventArgs(e, null); //UpdateAvailable depends on FileLocation. If it's null, it will be false. Assert.IsFalse(eventArgs.UpdateAvailable); }
private void OnUpdatePackageDownloaded(object sender, UpdateDownloadedEventArgs e) { if (null != e && null == e.Error && e.UpdateAvailable) { if (null == updateNotifier) { updateNotifier = new GraphUpdateNotificationControl(new LoggerWrapper()); updateNotifier.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; updateNotifier.VerticalAlignment = System.Windows.VerticalAlignment.Center; updateNotifier.ToolTip = "New update available"; this.ShortcutBar.Children.Add(updateNotifier); this.ShortcutBar.UpdateLayout(); } updateNotifier.Visibility = System.Windows.Visibility.Visible; } }
void updateManager_UpdateDownloaded(object sender, UpdateDownloadedEventArgs e) { UpdateManager.QuitAndInstallUpdate(); }
private void OnUpdatePackageDownloaded(object sender, UpdateDownloadedEventArgs e) { DisplayVersionInformation(e); }
private void OnUpdatePackageDownloaded(object sender, UpdateDownloadedEventArgs e) { if (null != e && null == e.Error && e.UpdateAvailable) { if (null == updateNotifier) { updateNotifier = new UpdateNotificationControl(new LoggerWrapper()); updateNotifier.VerticalAlignment = System.Windows.VerticalAlignment.Center; updateNotifier.Margin = new Thickness(0, 0, 1, 0); updateNotifier.SetValue(Grid.ColumnProperty, 1); this.MenuSplitter.Children.Add(updateNotifier); this.MenuSplitter.UpdateLayout(); } updateNotifier.Visibility = System.Windows.Visibility.Visible; } }