- Timestamp:
- 06/14/11 18:59:42 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/AvailablePluginsView.cs
r5445 r6413 117 117 void updateOrInstallPluginsBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { 118 118 UpdateOrInstallPluginsBackgroundWorkerArgument info = (UpdateOrInstallPluginsBackgroundWorkerArgument)e.Argument; 119 bool cancelled = false; 119 120 if (info.PluginsToInstall.Count() > 0) 120 installationManager.Install(info.PluginsToInstall );121 installationManager.Install(info.PluginsToInstall, out cancelled); 121 122 if (info.PluginsToUpdate.Count() > 0) 122 installationManager.Update(info.PluginsToUpdate );123 124 if ( info.PluginsToInstall.Count() > 0 || info.PluginsToUpdate.Count() > 0)123 installationManager.Update(info.PluginsToUpdate, out cancelled); 124 125 if (!cancelled && (info.PluginsToInstall.Count() > 0 || info.PluginsToUpdate.Count() > 0)) 125 126 pluginManager.DiscoverAndCheckPlugins(); 126 127 } … … 176 177 var pluginsToInstall = selectedProduct.Plugins.Except(pluginsToUpdate); 177 178 178 updateOrInstallInfo.PluginsToInstall = 179 updateOrInstallInfo.PluginsToInstall = 179 180 pluginsToInstall 180 181 .Cast<IPluginDescription>() 181 182 .ToList(); 182 updateOrInstallInfo.PluginsToUpdate = 183 updateOrInstallInfo.PluginsToUpdate = 183 184 pluginsToUpdate 184 185 .Cast<IPluginDescription>() -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs
r5445 r6413 79 79 select remotePlugin; 80 80 if (pluginsToUpdate.Count() > 0) { 81 installationManager.Update(pluginsToUpdate); 82 pluginManager.DiscoverAndCheckPlugins(); 81 bool cancelled; 82 installationManager.Update(pluginsToUpdate, out cancelled); 83 if (!cancelled) 84 pluginManager.DiscoverAndCheckPlugins(); 83 85 e.Cancel = false; 84 86 } else { -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManager.cs
r5445 r6413 98 98 /// </summary> 99 99 /// <param name="plugins"></param> 100 public void Install(IEnumerable<IPluginDescription> plugins ) {100 public void Install(IEnumerable<IPluginDescription> plugins, out bool cancelled) { 101 101 var args = new PluginInfrastructureCancelEventArgs(plugins); 102 102 OnPreInstall(args); 103 103 if (!args.Cancel) { 104 cancelled = false; 104 105 var client = DeploymentService.UpdateServiceClientFactory.CreateClient(); 105 106 try { … … 123 124 throw new InstallationManagerException("General communication exception in connection to server.", e); 124 125 } 126 } else { 127 cancelled = true; 125 128 } 126 129 } … … 130 133 /// </summary> 131 134 /// <param name="plugins"></param> 132 public void Update(IEnumerable<IPluginDescription> plugins ) {135 public void Update(IEnumerable<IPluginDescription> plugins, out bool cancelled) { 133 136 PluginInfrastructureCancelEventArgs args = new PluginInfrastructureCancelEventArgs(plugins); 134 137 OnPreUpdate(args); 135 138 if (!args.Cancel) { 139 cancelled = false; 136 140 var client = DeploymentService.UpdateServiceClientFactory.CreateClient(); 137 141 try { … … 155 159 throw new InstallationManagerException("General communication exception in connection to server.", e); 156 160 } 161 } else { 162 cancelled = true; 157 163 } 158 164 } -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs
r5445 r6413 116 116 select remotePlugin; 117 117 if (pluginsToUpdate.Count() > 0) { 118 installationManager.Update(pluginsToUpdate); 119 } 120 pluginManager.DiscoverAndCheckPlugins(); 118 bool cancelled; 119 installationManager.Update(pluginsToUpdate, out cancelled); 120 if (!cancelled) pluginManager.DiscoverAndCheckPlugins(); 121 } 121 122 } 122 123 -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/Util.cs
r5445 r6413 66 66 } 67 67 68 // compares for two plugins with same major and minor version if plugin1 is newer than plugin2 69 internal static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 70 // newer: build version is higher, or if build version is the same revision is higher 71 return plugin1.Version.Build > plugin2.Version.Build || 72 (plugin1.Version.Build == plugin2.Version.Build && plugin1.Version.Revision > plugin2.Version.Revision); 73 } 68 74 } 69 75 }
Note: See TracChangeset
for help on using the changeset viewer.