- Timestamp:
- 08/01/11 17:48:53 (13 years ago)
- Location:
- branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/AvailablePluginsView.cs
r5445 r6618 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>() -
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs
r5445 r6618 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 { -
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManager.cs
r5445 r6618 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 } -
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.Designer.cs
r5445 r6618 45 45 private void InitializeComponent() { 46 46 this.components = new System.ComponentModel.Container(); 47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallationManagerForm));48 47 this.statusStrip = new System.Windows.Forms.StatusStrip(); 49 48 this.toolStripProgressBar = new System.Windows.Forms.ToolStripProgressBar(); 50 49 this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); 51 50 this.tabControl = new System.Windows.Forms.TabControl(); 52 this.updateAllPluginsTabPage = new System.Windows.Forms.TabPage();53 this.basicUpdateView = new HeuristicLab.PluginInfrastructure.Advanced.BasicUpdateView();54 51 this.localPluginsTabPage = new System.Windows.Forms.TabPage(); 55 52 this.localPluginsView = new HeuristicLab.PluginInfrastructure.Advanced.InstalledPluginsView(); … … 68 65 this.statusStrip.SuspendLayout(); 69 66 this.tabControl.SuspendLayout(); 70 this.updateAllPluginsTabPage.SuspendLayout();71 67 this.localPluginsTabPage.SuspendLayout(); 72 68 this.availablePluginsTabPage.SuspendLayout(); … … 105 101 | System.Windows.Forms.AnchorStyles.Left) 106 102 | System.Windows.Forms.AnchorStyles.Right))); 107 this.tabControl.Controls.Add(this.updateAllPluginsTabPage);108 103 this.tabControl.Controls.Add(this.localPluginsTabPage); 109 104 this.tabControl.Controls.Add(this.availablePluginsTabPage); … … 118 113 this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); 119 114 // 120 // updateAllPluginsTabPage121 //122 this.updateAllPluginsTabPage.Controls.Add(this.basicUpdateView);123 this.updateAllPluginsTabPage.Location = new System.Drawing.Point(4, 22);124 this.updateAllPluginsTabPage.Name = "updateAllPluginsTabPage";125 this.updateAllPluginsTabPage.Padding = new System.Windows.Forms.Padding(3);126 this.updateAllPluginsTabPage.Size = new System.Drawing.Size(590, 366);127 this.updateAllPluginsTabPage.TabIndex = 5;128 this.updateAllPluginsTabPage.Text = "Update Plugins";129 this.toolTip.SetToolTip(this.updateAllPluginsTabPage, "Update all installed plugins");130 this.updateAllPluginsTabPage.UseVisualStyleBackColor = true;131 //132 // basicUpdateView133 //134 this.basicUpdateView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)135 | System.Windows.Forms.AnchorStyles.Left)136 | System.Windows.Forms.AnchorStyles.Right)));137 this.basicUpdateView.InstallationManager = null;138 this.basicUpdateView.Location = new System.Drawing.Point(6, 6);139 this.basicUpdateView.Name = "basicUpdateView";140 this.basicUpdateView.PluginManager = null;141 this.basicUpdateView.Size = new System.Drawing.Size(578, 354);142 this.basicUpdateView.StatusView = null;143 this.basicUpdateView.TabIndex = 0;144 //145 115 // localPluginsTabPage 146 116 // … … 298 268 this.Controls.Add(this.statusStrip); 299 269 this.Controls.Add(this.menuStrip); 300 this.Icon = HeuristicLab.PluginInfrastructure.Resources.HeuristicLab;270 this.Icon = global::HeuristicLab.PluginInfrastructure.Resources.HeuristicLab; 301 271 this.MainMenuStrip = this.menuStrip; 302 272 this.Name = "InstallationManagerForm"; … … 305 275 this.statusStrip.PerformLayout(); 306 276 this.tabControl.ResumeLayout(false); 307 this.updateAllPluginsTabPage.ResumeLayout(false);308 277 this.localPluginsTabPage.ResumeLayout(false); 309 278 this.availablePluginsTabPage.ResumeLayout(false); … … 338 307 private EditProductsView productEditor; 339 308 private InstalledPluginsView localPluginsView; 340 private System.Windows.Forms.TabPage updateAllPluginsTabPage;341 private BasicUpdateView basicUpdateView;342 309 private System.Windows.Forms.ToolTip toolTip; 343 310 } -
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs
r5445 r6618 67 67 localPluginsView.InstallationManager = installationManager; 68 68 69 basicUpdateView.StatusView = this;70 basicUpdateView.PluginManager = pluginManager;71 basicUpdateView.InstallationManager = installationManager;72 73 69 remotePluginInstaller.StatusView = this; 74 70 remotePluginInstaller.InstallationManager = installationManager; -
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs
r5445 r6618 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 -
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/Util.cs
r5445 r6618 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.