- Timestamp:
- 09/27/10 18:29:30 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/AvailablePluginsView.cs
r4482 r4527 311 311 } 312 312 313 // compares for two plugins with same major and minor version if plugin1 is newer than plugin2 313 314 private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 314 315 // newer: build version is higher, or if build version is the same revision is higher 315 if (plugin1.Version.Build < plugin2.Version.Build) return false; 316 else if (plugin1.Version.Build > plugin2.Version.Build) return true; 317 else return plugin1.Version.Revision > plugin2.Version.Revision; 316 return plugin1.Version.Build > plugin2.Version.Build || 317 (plugin1.Version.Build == plugin2.Version.Build && plugin1.Version.Revision > plugin2.Version.Revision); 318 318 } 319 319 #endregion -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs
r4482 r4527 87 87 } 88 88 89 // compares for two plugins with same major and minor version if plugin1 is newer than plugin2 89 90 private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 90 91 // newer: build version is higher, or if build version is the same revision is higher 91 if (plugin1.Version.Build < plugin2.Version.Build) return false; 92 else if (plugin1.Version.Build > plugin2.Version.Build) return true; 93 else return plugin1.Version.Revision > plugin2.Version.Revision; 92 return plugin1.Version.Build > plugin2.Version.Build || 93 (plugin1.Version.Build == plugin2.Version.Build && plugin1.Version.Revision > plugin2.Version.Revision); 94 94 } 95 95 -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs
r4482 r4527 83 83 84 84 #region plugin manager event handlers 85 void pluginManager_Initialized(object sender, PluginInfrastructureEventArgs e) {85 private void pluginManager_Initialized(object sender, PluginInfrastructureEventArgs e) { 86 86 SetStatusStrip("Initialized PluginInfrastructure"); 87 87 } 88 88 89 void pluginManager_Initializing(object sender, PluginInfrastructureEventArgs e) {89 private void pluginManager_Initializing(object sender, PluginInfrastructureEventArgs e) { 90 90 SetStatusStrip("Initializing PluginInfrastructure"); 91 91 } 92 92 93 void pluginManager_PluginUnloaded(object sender, PluginInfrastructureEventArgs e) {93 private void pluginManager_PluginUnloaded(object sender, PluginInfrastructureEventArgs e) { 94 94 SetStatusStrip("Unloaded " + e.Entity); 95 95 } 96 96 97 void pluginManager_PluginLoaded(object sender, PluginInfrastructureEventArgs e) {97 private void pluginManager_PluginLoaded(object sender, PluginInfrastructureEventArgs e) { 98 98 SetStatusStrip("Loaded " + e.Entity); 99 99 } … … 101 101 102 102 #region installation manager event handlers 103 void installationManager_PreUpdatePlugin(object sender, PluginInfrastructureCancelEventArgs e) {103 private void installationManager_PreUpdatePlugin(object sender, PluginInfrastructureCancelEventArgs e) { 104 104 if (e.Plugins.Count() > 0) { 105 e.Cancel = ConfirmUpdateAction(e.Plugins) == false;106 } 107 } 108 109 void installationManager_PreRemovePlugin(object sender, PluginInfrastructureCancelEventArgs e) {105 e.Cancel = (bool)Invoke((Func<IEnumerable<IPluginDescription>, bool>)ConfirmUpdateAction, e.Plugins) == false; 106 } 107 } 108 109 private void installationManager_PreRemovePlugin(object sender, PluginInfrastructureCancelEventArgs e) { 110 110 if (e.Plugins.Count() > 0) { 111 e.Cancel = ConfirmRemoveAction(e.Plugins) == false;112 } 113 } 114 115 void installationManager_PreInstallPlugin(object sender, PluginInfrastructureCancelEventArgs e) {111 e.Cancel = (bool)Invoke((Func<IEnumerable<IPluginDescription>, bool>)ConfirmRemoveAction, e.Plugins) == false; 112 } 113 } 114 115 private void installationManager_PreInstallPlugin(object sender, PluginInfrastructureCancelEventArgs e) { 116 116 if (e.Plugins.Count() > 0) 117 if ( ConfirmInstallAction(e.Plugins) == true) {117 if ((bool)Invoke((Func<IEnumerable<IPluginDescription>, bool>)ConfirmInstallAction, e.Plugins) == true) { 118 118 SetStatusStrip("Installing " + e.Plugins.Aggregate("", (a, b) => a.ToString() + "; " + b.ToString())); 119 119 e.Cancel = false; … … 124 124 } 125 125 126 void installationManager_PluginUpdated(object sender, PluginInfrastructureEventArgs e) {126 private void installationManager_PluginUpdated(object sender, PluginInfrastructureEventArgs e) { 127 127 SetStatusStrip("Updated " + e.Entity); 128 128 } 129 129 130 void installationManager_PluginRemoved(object sender, PluginInfrastructureEventArgs e) {130 private void installationManager_PluginRemoved(object sender, PluginInfrastructureEventArgs e) { 131 131 SetStatusStrip("Removed " + e.Entity); 132 132 } 133 133 134 void installationManager_PluginInstalled(object sender, PluginInfrastructureEventArgs e) {134 private void installationManager_PluginInstalled(object sender, PluginInfrastructureEventArgs e) { 135 135 SetStatusStrip("Installed " + e.Entity); 136 136 } -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs
r4482 r4527 120 120 } 121 121 122 // compares for two plugins with same major and minor version if plugin1 is newer than plugin2 122 123 private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 123 124 // newer: build version is higher, or if build version is the same revision is higher 124 if (plugin1.Version.Build < plugin2.Version.Build) return false; 125 else if (plugin1.Version.Build > plugin2.Version.Build) return true; 126 else return plugin1.Version.Revision > plugin2.Version.Revision; 125 return plugin1.Version.Build > plugin2.Version.Build || 126 (plugin1.Version.Build == plugin2.Version.Build && plugin1.Version.Revision > plugin2.Version.Revision); 127 127 } 128 128 #endregion
Note: See TracChangeset
for help on using the changeset viewer.