public void OnPackageListDownloadEnded(object sender, PackageListDownloadEndedEventArgs e)
 {
     if (PackageListDownloadEnded != null)
     {
         SD.Log.DebugFormatted("[AddInManager2.Events] Package list download ended (success: {0}).", e.WasSuccessful);
         PackageListDownloadEnded(sender, e);
     }
 }
Exemplo n.º 2
0
		public void OnPackageListDownloadEnded(object sender, PackageListDownloadEndedEventArgs e)
		{
			if (PackageListDownloadEnded != null)
			{
				SD.Log.DebugFormatted("[AddInManager2.Events] Package list download ended (success: {0}).", e.WasSuccessful);
				PackageListDownloadEnded(sender, e);
			}
		}
Exemplo n.º 3
0
		private void Events_PackageListDownloadEnded(object sender, PackageListDownloadEndedEventArgs e)
		{
			if (sender != _updatedAddInViewModel)
			{
				return;
			}
			
			if (e.WasCancelled)
			{
				return;
			}
			
			// Do we have any new updates? Collect this information from all configured repositories
			if (e.WasSuccessful)
			{
				_firstRepositoryWithUpdates = _updatedAddInViewModel.PackageRepositories.FirstOrDefault(pr => pr.HasHighlightCount);
				if (_firstRepositoryWithUpdates != null)
				{
					// There must be updates, show an update notification
					_hasNotified = true;
					Detach();
					
					_services.Events.AddInManagerViewOpened += Events_AddInManagerViewOpened;
					
					_notifyIcon = new NotifyIcon();
					_notifyIcon.Icon = Icon.ExtractAssociatedIcon(Assembly.GetEntryAssembly().Location);
					_notifyIcon.Click += NotifyIcon_Click;
					_notifyIcon.BalloonTipClicked += NotifyIcon_Click;
					
					_notifyIcon.Text = SD.ResourceService.GetString("AddInManager2.UpdateNotifier.BubbleTitle");
					_notifyIcon.BalloonTipTitle = _notifyIcon.Text;
					_notifyIcon.BalloonTipText = SD.ResourceService.GetString("AddInManager2.UpdateNotifier.BubbleText");
					
					_notifyIcon.Visible = true;
					_notifyIcon.ShowBalloonTip(40000);
					
					return;
				}
			}
			
			Detach();
		}