private void OnNewUpdateFound(IInstallableExtension update) { var updateBehavior = settingsService.Get(SettingsKeys.AutoUpdateKey, AutoUpdateBehavior.DownloadAndInstall); if (updateBehavior == AutoUpdateBehavior.NotificationOnly || (update == null && updateBehavior == AutoUpdateBehavior.DownloadAndInstall)) { string text = string.Format("There is a new Version of {0} available! [Click here to update](2)", Extension.Header.Name); // (2) is the command parameter var teamExplorer = serviceProvider.Get <ITeamExplorer>(); teamExplorer.ShowNotification(text, NotificationType.Information, NotificationFlags.RequiresConfirmation, ShowVSExtensionManagerCommand, GuidList.UpdateNotificationId); } else if (updateBehavior == AutoUpdateBehavior.DownloadAndInstall && update != null) { ExtensionUpdater.UpdateExtension(Extension, update); } }
private void BeginUpdateCheck() { var updateBehavior = settingsService.Get(SettingsKeys.AutoUpdateKey, AutoUpdateBehavior.DownloadAndInstall); if (Extension != null && updateBehavior != AutoUpdateBehavior.None) { IInstallableExtension update; bool updateAvailable = ExtensionUpdater.CheckForUpdate(Extension, out update); if (updateAvailable && update != null) { OnNewUpdateFound(update); } } }