Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/27/10 18:29:30 (14 years ago)
Author:
gkronber
Message:

Fixed #1216 via Invoke() call.

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  
    311311    }
    312312
     313    // compares for two plugins with same major and minor version if plugin1 is newer than plugin2
    313314    private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    314315      // 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);
    318318    }
    319319    #endregion
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs

    r4482 r4527  
    8787    }
    8888
     89    // compares for two plugins with same major and minor version if plugin1 is newer than plugin2
    8990    private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    9091      // 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);
    9494    }
    9595
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs

    r4482 r4527  
    8383
    8484    #region plugin manager event handlers
    85     void pluginManager_Initialized(object sender, PluginInfrastructureEventArgs e) {
     85    private void pluginManager_Initialized(object sender, PluginInfrastructureEventArgs e) {
    8686      SetStatusStrip("Initialized PluginInfrastructure");
    8787    }
    8888
    89     void pluginManager_Initializing(object sender, PluginInfrastructureEventArgs e) {
     89    private void pluginManager_Initializing(object sender, PluginInfrastructureEventArgs e) {
    9090      SetStatusStrip("Initializing PluginInfrastructure");
    9191    }
    9292
    93     void pluginManager_PluginUnloaded(object sender, PluginInfrastructureEventArgs e) {
     93    private void pluginManager_PluginUnloaded(object sender, PluginInfrastructureEventArgs e) {
    9494      SetStatusStrip("Unloaded " + e.Entity);
    9595    }
    9696
    97     void pluginManager_PluginLoaded(object sender, PluginInfrastructureEventArgs e) {
     97    private void pluginManager_PluginLoaded(object sender, PluginInfrastructureEventArgs e) {
    9898      SetStatusStrip("Loaded " + e.Entity);
    9999    }
     
    101101
    102102    #region installation manager event handlers
    103     void installationManager_PreUpdatePlugin(object sender, PluginInfrastructureCancelEventArgs e) {
     103    private void installationManager_PreUpdatePlugin(object sender, PluginInfrastructureCancelEventArgs e) {
    104104      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) {
    110110      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) {
    116116      if (e.Plugins.Count() > 0)
    117         if (ConfirmInstallAction(e.Plugins) == true) {
     117        if ((bool)Invoke((Func<IEnumerable<IPluginDescription>, bool>)ConfirmInstallAction, e.Plugins) == true) {
    118118          SetStatusStrip("Installing " + e.Plugins.Aggregate("", (a, b) => a.ToString() + "; " + b.ToString()));
    119119          e.Cancel = false;
     
    124124    }
    125125
    126     void installationManager_PluginUpdated(object sender, PluginInfrastructureEventArgs e) {
     126    private void installationManager_PluginUpdated(object sender, PluginInfrastructureEventArgs e) {
    127127      SetStatusStrip("Updated " + e.Entity);
    128128    }
    129129
    130     void installationManager_PluginRemoved(object sender, PluginInfrastructureEventArgs e) {
     130    private void installationManager_PluginRemoved(object sender, PluginInfrastructureEventArgs e) {
    131131      SetStatusStrip("Removed " + e.Entity);
    132132    }
    133133
    134     void installationManager_PluginInstalled(object sender, PluginInfrastructureEventArgs e) {
     134    private void installationManager_PluginInstalled(object sender, PluginInfrastructureEventArgs e) {
    135135      SetStatusStrip("Installed " + e.Entity);
    136136    }
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs

    r4482 r4527  
    120120    }
    121121
     122    // compares for two plugins with same major and minor version if plugin1 is newer than plugin2
    122123    private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    123124      // 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);
    127127    }
    128128    #endregion
Note: See TracChangeset for help on using the changeset viewer.