/// <summary>
        /// Check for any update available and run the plugin installer
        /// </summary>
        /// <param name="viewInvoker">An <see cref="IViewInvokerService"/></param>
        /// <param name="processRunner">An <see cref="IProcessRunnerService"/></param>
        /// <returns>An Assert whether the IME have to shut down</returns>
        public static bool CheckInstallAndVerifyIfTheImeShallShutdown(IViewInvokerService viewInvoker = null, IProcessRunnerService processRunner = null)
        {
            var imeUpdate = CheckForImeUpdate();

            if (imeUpdate != null && (viewInvoker ?? new ViewInvokerService()).ShowMessageBox(ImeNewVersionMessage, "IME Update", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
            {
                RunInstaller(imeUpdate, processRunner);
                return(true);
            }

            var updatablePlugins = PluginUtilities.GetDownloadedInstallablePluginUpdate().ToList();

            if (updatablePlugins.Any())
            {
                var pluginInstallerView = new UpdateDownloaderInstaller()
                {
                    DataContext = new UpdateDownloaderInstallerViewModel(updatablePlugins)
                };
                (viewInvoker ?? new ViewInvokerService()).ShowDialog(pluginInstallerView);
            }

            return(false);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Brings the view to the user sight
 /// </summary>
 /// <param name="viewInstance">the view to show up</param>
 public void ShowDialog(UpdateDownloaderInstaller viewInstance)
 {
     viewInstance.ShowDialog();
 }