private void refreshButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); // refresh = update empty list of plugins (plugins are reloaded) updatePluginsBackgroundWorker.RunWorkerAsync(new IPluginDescription[0]); }
private void refreshButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); StatusView.ShowMessage(RefreshMessage); refreshProductsWorker.RunWorkerAsync(); }
private void saveButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); StatusView.ShowMessage(UploadMessage); uploadChangedProductsWorker.RunWorkerAsync(dirtyProducts); }
private void installProductsButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); var updateOrInstallInfo = new UpdateOrInstallPluginsBackgroundWorkerArgument(); var selectedProduct = (DeploymentService.ProductDescription)productsListView.SelectedItems[0].Tag; // if there is a local plugin with same name and same major and minor version then it's an update var pluginsToUpdate = from plugin in selectedProduct.Plugins let matchingLocalPlugins = from localPlugin in pluginManager.Plugins where localPlugin.Name == plugin.Name where localPlugin.Version.Major == plugin.Version.Major where localPlugin.Version.Minor == plugin.Version.Minor where IsNewerThan(plugin, localPlugin) select localPlugin where matchingLocalPlugins.Count() > 0 select plugin; // otherwise install a new plugin var pluginsToInstall = selectedProduct.Plugins.Except(pluginsToUpdate); updateOrInstallInfo.PluginsToInstall = pluginsToInstall .Cast <IPluginDescription>() .ToList(); updateOrInstallInfo.PluginsToUpdate = pluginsToUpdate .Cast <IPluginDescription>() .ToList(); updateOrInstallPluginsBackgroundWorker.RunWorkerAsync(updateOrInstallInfo); }
private void refreshRemoteButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); StatusView.ShowMessage(PluginDiscoveryMessage); refreshServerPluginsBackgroundWorker.RunWorkerAsync(); }
private void updateAndInstallButton_Click(object sender, EventArgs e) { var installedPlugins = pluginManager.Plugins.OfType <IPluginDescription>().ToList(); updatePluginsBackgroundWorker.RunWorkerAsync(installedPlugins); StatusView.LockUI(); StatusView.ShowProgressIndicator(); StatusView.RemoveMessage(NoUpdatesAvailableMessage); StatusView.ShowMessage(CheckingPluginsMessage); }
private void deleteProductButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); StatusView.ShowMessage(DeleteProductMessage); var selectedProducts = from item in productsListView.SelectedItems.OfType <ListViewItem>() select(DeploymentService.ProductDescription) item.Tag; deleteProductWorker.RunWorkerAsync(selectedProducts.ToList()); }
private void removeButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); var checkedPlugins = localPluginsListView.CheckedItems.OfType <ListViewItem>() .Select(item => item.Tag) .OfType <IPluginDescription>() .ToList(); removePluginsBackgroundWorker.RunWorkerAsync(checkedPlugins); }
private void updateSelectedButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); StatusView.RemoveMessage(NoUpdatesAvailableMessage); StatusView.ShowMessage(CheckingPluginsMessage); var checkedPlugins = localPluginsListView.CheckedItems.OfType <ListViewItem>() .Select(item => item.Tag) .OfType <IPluginDescription>() .ToList(); updatePluginsBackgroundWorker.RunWorkerAsync(checkedPlugins); }
private void uploadButton_Click(object sender, EventArgs e) { var selectedPlugins = from item in listView.Items.Cast <ListViewItem>() where item.Checked where item.Tag is IPluginDescription select item.Tag as IPluginDescription; if (selectedPlugins.Count() > 0) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); StatusView.ShowMessage(UploadMessage); pluginUploadWorker.RunWorkerAsync(selectedPlugins.ToList()); } }
private void installPluginsButton_Click(object sender, EventArgs e) { StatusView.LockUI(); StatusView.ShowProgressIndicator(); var updateOrInstallInfo = new UpdateOrInstallPluginsBackgroundWorkerArgument(); // if there is a local plugin with same name and same major and minor version then it's an update var pluginsToUpdate = from remotePlugin in CheckedPlugins let matchingLocalPlugins = from localPlugin in pluginManager.Plugins where localPlugin.Name == remotePlugin.Name where localPlugin.Version.Major == remotePlugin.Version.Major where localPlugin.Version.Minor == remotePlugin.Version.Minor where IsNewerThan(remotePlugin, localPlugin) select localPlugin where matchingLocalPlugins.Count() > 0 select remotePlugin; // otherwise install a new plugin var pluginsToInstall = CheckedPlugins.Except(pluginsToUpdate); updateOrInstallInfo.PluginsToInstall = pluginsToInstall; updateOrInstallInfo.PluginsToUpdate = pluginsToUpdate; updateOrInstallPluginsBackgroundWorker.RunWorkerAsync(updateOrInstallInfo); }