Beispiel #1
0
 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);
            }
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
        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);
        }
Beispiel #6
0
 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;
     }
 }
Beispiel #7
0
 void updateManager_UpdateDownloaded(object sender, UpdateDownloadedEventArgs e)
 {
     UpdateManager.QuitAndInstallUpdate();
 }
 private void OnUpdatePackageDownloaded(object sender, UpdateDownloadedEventArgs e)
 {
     DisplayVersionInformation(e);
 }
Beispiel #9
0
 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 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;
     }
 }
 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;
     }
 }
Beispiel #12
0
 private void OnUpdateDownloaded(UpdateDownloadedEventArgs e)
 {
     if (UpdateDownloaded != null)
     {
         UpdateDownloaded(this, e);
     }
 }