Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/14/11 13:59:25 (13 years ago)
Author:
epitzer
Message:

#1530 integrate changes from trunk

Location:
branches/PersistenceSpeedUp
Files:
17 edited
9 copied

Legend:

Unmodified
Added
Removed
  • branches/PersistenceSpeedUp

  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/AvailablePluginsView.cs

    r5445 r6760  
    117117    void updateOrInstallPluginsBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) {
    118118      UpdateOrInstallPluginsBackgroundWorkerArgument info = (UpdateOrInstallPluginsBackgroundWorkerArgument)e.Argument;
     119      bool cancelled = false;
    119120      if (info.PluginsToInstall.Count() > 0)
    120         installationManager.Install(info.PluginsToInstall);
     121        installationManager.Install(info.PluginsToInstall, out cancelled);
    121122      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))
    125126        pluginManager.DiscoverAndCheckPlugins();
    126127    }
     
    176177      var pluginsToInstall = selectedProduct.Plugins.Except(pluginsToUpdate);
    177178
    178       updateOrInstallInfo.PluginsToInstall = 
     179      updateOrInstallInfo.PluginsToInstall =
    179180        pluginsToInstall
    180181        .Cast<IPluginDescription>()
    181182        .ToList();
    182       updateOrInstallInfo.PluginsToUpdate = 
     183      updateOrInstallInfo.PluginsToUpdate =
    183184        pluginsToUpdate
    184185        .Cast<IPluginDescription>()
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs

    r5445 r6760  
    7979                            select remotePlugin;
    8080      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();
    8385        e.Cancel = false;
    8486      } else {
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/DeploymentService/ServiceClients.cs

    r4722 r6760  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.1
     4//     Runtime Version:4.0.30319.225
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    99//------------------------------------------------------------------------------
    1010
    11 namespace HeuristicLab.PluginInfrastructure.Advanced.DeploymentService {
    12 
    13 
    14   [System.Diagnostics.DebuggerStepThroughAttribute()]
     11namespace HeuristicLab.PluginInfrastructure.Advanced.DeploymentService
     12{
     13    using System.Runtime.Serialization;
     14   
     15   
     16    [System.Diagnostics.DebuggerStepThroughAttribute()]
    1517    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    1618    [System.Runtime.Serialization.DataContractAttribute(Name="PluginDescription", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Deployment", IsReference=true)]
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManager.cs

    r5445 r6760  
    9898    /// </summary>
    9999    /// <param name="plugins"></param>
    100     public void Install(IEnumerable<IPluginDescription> plugins) {
     100    public void Install(IEnumerable<IPluginDescription> plugins, out bool cancelled) {
    101101      var args = new PluginInfrastructureCancelEventArgs(plugins);
    102102      OnPreInstall(args);
    103103      if (!args.Cancel) {
     104        cancelled = false;
    104105        var client = DeploymentService.UpdateServiceClientFactory.CreateClient();
    105106        try {
     
    123124          throw new InstallationManagerException("General communication exception in connection to server.", e);
    124125        }
     126      } else {
     127        cancelled = true;
    125128      }
    126129    }
     
    130133    /// </summary>
    131134    /// <param name="plugins"></param>
    132     public void Update(IEnumerable<IPluginDescription> plugins) {
     135    public void Update(IEnumerable<IPluginDescription> plugins, out bool cancelled) {
    133136      PluginInfrastructureCancelEventArgs args = new PluginInfrastructureCancelEventArgs(plugins);
    134137      OnPreUpdate(args);
    135138      if (!args.Cancel) {
     139        cancelled = false;
    136140        var client = DeploymentService.UpdateServiceClientFactory.CreateClient();
    137141        try {
     
    155159          throw new InstallationManagerException("General communication exception in connection to server.", e);
    156160        }
     161      } else {
     162        cancelled = true;
    157163      }
    158164    }
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.Designer.cs

    r5445 r6760  
    4545    private void InitializeComponent() {
    4646      this.components = new System.ComponentModel.Container();
    47       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallationManagerForm));
    4847      this.statusStrip = new System.Windows.Forms.StatusStrip();
    4948      this.toolStripProgressBar = new System.Windows.Forms.ToolStripProgressBar();
    5049      this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
    5150      this.tabControl = new System.Windows.Forms.TabControl();
    52       this.updateAllPluginsTabPage = new System.Windows.Forms.TabPage();
    53       this.basicUpdateView = new HeuristicLab.PluginInfrastructure.Advanced.BasicUpdateView();
    5451      this.localPluginsTabPage = new System.Windows.Forms.TabPage();
    5552      this.localPluginsView = new HeuristicLab.PluginInfrastructure.Advanced.InstalledPluginsView();
     
    6865      this.statusStrip.SuspendLayout();
    6966      this.tabControl.SuspendLayout();
    70       this.updateAllPluginsTabPage.SuspendLayout();
    7167      this.localPluginsTabPage.SuspendLayout();
    7268      this.availablePluginsTabPage.SuspendLayout();
     
    105101                  | System.Windows.Forms.AnchorStyles.Left)
    106102                  | System.Windows.Forms.AnchorStyles.Right)));
    107       this.tabControl.Controls.Add(this.updateAllPluginsTabPage);
    108103      this.tabControl.Controls.Add(this.localPluginsTabPage);
    109104      this.tabControl.Controls.Add(this.availablePluginsTabPage);
     
    118113      this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
    119114      //
    120       // updateAllPluginsTabPage
    121       //
    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       // basicUpdateView
    133       //
    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       //
    145115      // localPluginsTabPage
    146116      //
     
    298268      this.Controls.Add(this.statusStrip);
    299269      this.Controls.Add(this.menuStrip);
    300       this.Icon = HeuristicLab.PluginInfrastructure.Resources.HeuristicLab;
     270      this.Icon = global::HeuristicLab.PluginInfrastructure.Resources.HeuristicLab;
    301271      this.MainMenuStrip = this.menuStrip;
    302272      this.Name = "InstallationManagerForm";
     
    305275      this.statusStrip.PerformLayout();
    306276      this.tabControl.ResumeLayout(false);
    307       this.updateAllPluginsTabPage.ResumeLayout(false);
    308277      this.localPluginsTabPage.ResumeLayout(false);
    309278      this.availablePluginsTabPage.ResumeLayout(false);
     
    338307    private EditProductsView productEditor;
    339308    private InstalledPluginsView localPluginsView;
    340     private System.Windows.Forms.TabPage updateAllPluginsTabPage;
    341     private BasicUpdateView basicUpdateView;
    342309    private System.Windows.Forms.ToolTip toolTip;
    343310  }
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs

    r5445 r6760  
    6767      localPluginsView.InstallationManager = installationManager;
    6868
    69       basicUpdateView.StatusView = this;
    70       basicUpdateView.PluginManager = pluginManager;
    71       basicUpdateView.InstallationManager = installationManager;
    72 
    7369      remotePluginInstaller.StatusView = this;
    7470      remotePluginInstaller.InstallationManager = installationManager;
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs

    r5445 r6760  
    116116                            select remotePlugin;
    117117      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      }
    121122    }
    122123
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Advanced/Util.cs

    r5445 r6760  
    6666    }
    6767
     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    }
    6874  }
    6975}
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj

    r6174 r6760  
    144144      <DependentUpon>ConnectionSetupView.cs</DependentUpon>
    145145    </Compile>
     146    <Compile Include="Advanced\PluginUpdaterForm.cs">
     147      <SubType>Form</SubType>
     148    </Compile>
     149    <Compile Include="Advanced\PluginUpdaterForm.Designer.cs">
     150      <DependentUpon>PluginUpdaterForm.cs</DependentUpon>
     151    </Compile>
    146152    <Compile Include="Advanced\DeploymentService\AdminServiceClientFactory.cs" />
    147153    <Compile Include="Advanced\DeploymentService\DeploymentServerCertificateValidator.cs" />
     
    259265    <Compile Include="Properties\AssemblyInfo.cs" />
    260266    <None Include="Advanced\DeploymentService\GenerateServiceClients.cmd" />
    261     <None Include="app.config" />
     267    <None Include="app.config">
     268      <SubType>Designer</SubType>
     269    </None>
    262270    <None Include="HeuristicLab.snk" />
    263271    <None Include="Properties\AssemblyInfo.frame" />
     
    308316    <None Include="Resources\HeuristicLabLogo.png" />
    309317    <None Include="Resources\HeuristicLabBanner.png" />
    310     <None Include="Resources\VS2008ImageLibrary_Actions_Delete.png" />
     318    <Content Include="Resources\UpdateAvailable.ico" />
    311319    <Content Include="Resources\VS2008ImageLibrary_Actions_PublishToWebHS.png" />
    312320    <Content Include="Resources\VS2008ImageLibrary_Actions_RepeatHS.png" />
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Manager/PluginValidator.cs

    r6021 r6760  
    406406    // and sets the dependencies in the plugin descriptions
    407407    private void BuildDependencyTree(IEnumerable<PluginDescription> pluginDescriptions) {
    408       foreach (var desc in pluginDescriptions) {
     408      foreach (var desc in pluginDescriptions.Where(x => x.PluginState != PluginState.Disabled)) {
    409409        var missingDependencies = new List<PluginDependency>();
    410410        foreach (var dependency in pluginDependencies[desc]) {
    411411          var matchingDescriptions = from availablePlugin in pluginDescriptions
     412                                     where availablePlugin.PluginState != PluginState.Disabled
    412413                                     where availablePlugin.Name == dependency.Name
    413414                                     where IsCompatiblePluginVersion(availablePlugin.Version, dependency.Version)
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Properties/AssemblyInfo.frame

    r6099 r6760  
    3838[assembly: AssemblyCulture("")]
    3939[assembly: CLSCompliant(true)]
     40[assembly: InternalsVisibleTo("HeuristicLab.PluginInfrastructure-3.3.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e3d38bc66a0dd8dd36f57285e34632ec04b3049866ab1e64cf230e95ffcbfbb90c437b4d11dfe74ba981f746274290bb03f3e636e139e685b501031dc6e0bc8409153f0c842721eb9e8e2a703c9e4d102283f3ddbdfab4078c08de51869715992a694d2f608d0fa865c9d17c06b8d6a9135004e982fd862cdb2277e4ad15a4a6")]
    4041
    4142// Setting ComVisible to false makes the types in this assembly not visible
     
    5556//
    5657[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.4.$WCREV$")]
     58[assembly: AssemblyFileVersion("3.3.5.$WCREV$")]
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Resources.Designer.cs

    r4068 r6760  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.1
     4//     Runtime Version:4.0.30319.225
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    1010
    1111namespace HeuristicLab.PluginInfrastructure {
    12 
    13 
    14   /// <summary>
    15   ///   A strongly-typed resource class, for looking up localized strings, etc.
    16   /// </summary>
    17   // This class was auto-generated by the StronglyTypedResourceBuilder
    18   // class via a tool like ResGen or Visual Studio.
    19   // To add or remove a member, edit your .ResX file then rerun ResGen
    20   // with the /str option, or rebuild your VS project.
    21   [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    22   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    23   [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    24   internal class Resources {
    25 
    26     private static global::System.Resources.ResourceManager resourceMan;
    27 
    28     private static global::System.Globalization.CultureInfo resourceCulture;
    29 
    30     [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
    31     internal Resources() {
     12    using System;
     13   
     14   
     15    /// <summary>
     16    ///   A strongly-typed resource class, for looking up localized strings, etc.
     17    /// </summary>
     18    // This class was auto-generated by the StronglyTypedResourceBuilder
     19    // class via a tool like ResGen or Visual Studio.
     20    // To add or remove a member, edit your .ResX file then rerun ResGen
     21    // with the /str option, or rebuild your VS project.
     22    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
     23    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     24    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     25    internal class Resources {
     26       
     27        private static global::System.Resources.ResourceManager resourceMan;
     28       
     29        private static global::System.Globalization.CultureInfo resourceCulture;
     30       
     31        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
     32        internal Resources() {
     33        }
     34       
     35        /// <summary>
     36        ///   Returns the cached ResourceManager instance used by this class.
     37        /// </summary>
     38        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
     39        internal static global::System.Resources.ResourceManager ResourceManager {
     40            get {
     41                if (object.ReferenceEquals(resourceMan, null)) {
     42                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeuristicLab.PluginInfrastructure.Resources", typeof(Resources).Assembly);
     43                    resourceMan = temp;
     44                }
     45                return resourceMan;
     46            }
     47        }
     48       
     49        /// <summary>
     50        ///   Overrides the current thread's CurrentUICulture property for all
     51        ///   resource lookups using this strongly typed resource class.
     52        /// </summary>
     53        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
     54        internal static global::System.Globalization.CultureInfo Culture {
     55            get {
     56                return resourceCulture;
     57            }
     58            set {
     59                resourceCulture = value;
     60            }
     61        }
     62       
     63        internal static System.Drawing.Bitmap Add {
     64            get {
     65                object obj = ResourceManager.GetObject("Add", resourceCulture);
     66                return ((System.Drawing.Bitmap)(obj));
     67            }
     68        }
     69       
     70        internal static System.Drawing.Bitmap ArrowUp {
     71            get {
     72                object obj = ResourceManager.GetObject("ArrowUp", resourceCulture);
     73                return ((System.Drawing.Bitmap)(obj));
     74            }
     75        }
     76       
     77        internal static System.Drawing.Bitmap Assembly {
     78            get {
     79                object obj = ResourceManager.GetObject("Assembly", resourceCulture);
     80                return ((System.Drawing.Bitmap)(obj));
     81            }
     82        }
     83       
     84        internal static System.Drawing.Bitmap Document {
     85            get {
     86                object obj = ResourceManager.GetObject("Document", resourceCulture);
     87                return ((System.Drawing.Bitmap)(obj));
     88            }
     89        }
     90       
     91        internal static System.Drawing.Bitmap Error {
     92            get {
     93                object obj = ResourceManager.GetObject("Error", resourceCulture);
     94                return ((System.Drawing.Bitmap)(obj));
     95            }
     96        }
     97       
     98        internal static System.Drawing.Icon ErrorIcon {
     99            get {
     100                object obj = ResourceManager.GetObject("ErrorIcon", resourceCulture);
     101                return ((System.Drawing.Icon)(obj));
     102            }
     103        }
     104       
     105        internal static System.Drawing.Bitmap File {
     106            get {
     107                object obj = ResourceManager.GetObject("File", resourceCulture);
     108                return ((System.Drawing.Bitmap)(obj));
     109            }
     110        }
     111       
     112        internal static System.Drawing.Icon HeuristicLab {
     113            get {
     114                object obj = ResourceManager.GetObject("HeuristicLab", resourceCulture);
     115                return ((System.Drawing.Icon)(obj));
     116            }
     117        }
     118       
     119        internal static System.Drawing.Bitmap HeuristicLabBanner {
     120            get {
     121                object obj = ResourceManager.GetObject("HeuristicLabBanner", resourceCulture);
     122                return ((System.Drawing.Bitmap)(obj));
     123            }
     124        }
     125       
     126        internal static System.Drawing.Bitmap HeuristicLabLogo {
     127            get {
     128                object obj = ResourceManager.GetObject("HeuristicLabLogo", resourceCulture);
     129                return ((System.Drawing.Bitmap)(obj));
     130            }
     131        }
     132       
     133        internal static System.Drawing.Bitmap Install {
     134            get {
     135                object obj = ResourceManager.GetObject("Install", resourceCulture);
     136                return ((System.Drawing.Bitmap)(obj));
     137            }
     138        }
     139       
     140        internal static System.Drawing.Bitmap Internet {
     141            get {
     142                object obj = ResourceManager.GetObject("Internet", resourceCulture);
     143                return ((System.Drawing.Bitmap)(obj));
     144            }
     145        }
     146       
     147        /// <summary>
     148        ///   Looks up a localized string similar to HeuristicLab is free software: you can redistribute it and/or modify
     149        ///it under the terms of the GNU General Public License as published by
     150        ///the Free Software Foundation, either version 3 of the License, or
     151        ///(at your option) any later version.
     152        ///
     153        ///HeuristicLab is distributed in the hope that it will be useful,
     154        ///but WITHOUT ANY WARRANTY; without even the implied warranty of
     155        ///MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     156        ///GNU General Public License for more details.
     157        ///
     158        ///You should have received a copy of t [rest of string was truncated]&quot;;.
     159        /// </summary>
     160        internal static string LicenseText {
     161            get {
     162                return ResourceManager.GetString("LicenseText", resourceCulture);
     163            }
     164        }
     165       
     166        internal static System.Drawing.Bitmap NetworkConnections {
     167            get {
     168                object obj = ResourceManager.GetObject("NetworkConnections", resourceCulture);
     169                return ((System.Drawing.Bitmap)(obj));
     170            }
     171        }
     172       
     173        internal static System.Drawing.Bitmap Plugin {
     174            get {
     175                object obj = ResourceManager.GetObject("Plugin", resourceCulture);
     176                return ((System.Drawing.Bitmap)(obj));
     177            }
     178        }
     179       
     180        internal static System.Drawing.Bitmap PublishToWeb {
     181            get {
     182                object obj = ResourceManager.GetObject("PublishToWeb", resourceCulture);
     183                return ((System.Drawing.Bitmap)(obj));
     184            }
     185        }
     186       
     187        internal static System.Drawing.Bitmap Remove {
     188            get {
     189                object obj = ResourceManager.GetObject("Remove", resourceCulture);
     190                return ((System.Drawing.Bitmap)(obj));
     191            }
     192        }
     193       
     194        internal static System.Drawing.Bitmap Repeat {
     195            get {
     196                object obj = ResourceManager.GetObject("Repeat", resourceCulture);
     197                return ((System.Drawing.Bitmap)(obj));
     198            }
     199        }
     200       
     201        internal static System.Drawing.Icon Setup_Install {
     202            get {
     203                object obj = ResourceManager.GetObject("Setup_Install", resourceCulture);
     204                return ((System.Drawing.Icon)(obj));
     205            }
     206        }
     207       
     208        internal static System.Drawing.Bitmap ShowDetails {
     209            get {
     210                object obj = ResourceManager.GetObject("ShowDetails", resourceCulture);
     211                return ((System.Drawing.Bitmap)(obj));
     212            }
     213        }
     214       
     215        internal static System.Drawing.Bitmap ShowIcons {
     216            get {
     217                object obj = ResourceManager.GetObject("ShowIcons", resourceCulture);
     218                return ((System.Drawing.Bitmap)(obj));
     219            }
     220        }
     221       
     222        internal static System.Drawing.Icon UpdateAvailable {
     223            get {
     224                object obj = ResourceManager.GetObject("UpdateAvailable", resourceCulture);
     225                return ((System.Drawing.Icon)(obj));
     226            }
     227        }
    32228    }
    33 
    34     /// <summary>
    35     ///   Returns the cached ResourceManager instance used by this class.
    36     /// </summary>
    37     [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
    38     internal static global::System.Resources.ResourceManager ResourceManager {
    39       get {
    40         if (object.ReferenceEquals(resourceMan, null)) {
    41           global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeuristicLab.PluginInfrastructure.Resources", typeof(Resources).Assembly);
    42           resourceMan = temp;
    43         }
    44         return resourceMan;
    45       }
    46     }
    47 
    48     /// <summary>
    49     ///   Overrides the current thread's CurrentUICulture property for all
    50     ///   resource lookups using this strongly typed resource class.
    51     /// </summary>
    52     [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
    53     internal static global::System.Globalization.CultureInfo Culture {
    54       get {
    55         return resourceCulture;
    56       }
    57       set {
    58         resourceCulture = value;
    59       }
    60     }
    61 
    62     internal static System.Drawing.Bitmap Add {
    63       get {
    64         object obj = ResourceManager.GetObject("Add", resourceCulture);
    65         return ((System.Drawing.Bitmap)(obj));
    66       }
    67     }
    68 
    69     internal static System.Drawing.Bitmap ArrowUp {
    70       get {
    71         object obj = ResourceManager.GetObject("ArrowUp", resourceCulture);
    72         return ((System.Drawing.Bitmap)(obj));
    73       }
    74     }
    75 
    76     internal static System.Drawing.Bitmap Assembly {
    77       get {
    78         object obj = ResourceManager.GetObject("Assembly", resourceCulture);
    79         return ((System.Drawing.Bitmap)(obj));
    80       }
    81     }
    82 
    83     internal static System.Drawing.Bitmap Document {
    84       get {
    85         object obj = ResourceManager.GetObject("Document", resourceCulture);
    86         return ((System.Drawing.Bitmap)(obj));
    87       }
    88     }
    89 
    90     internal static System.Drawing.Bitmap Error {
    91       get {
    92         object obj = ResourceManager.GetObject("Error", resourceCulture);
    93         return ((System.Drawing.Bitmap)(obj));
    94       }
    95     }
    96 
    97     internal static System.Drawing.Icon ErrorIcon {
    98       get {
    99         object obj = ResourceManager.GetObject("ErrorIcon", resourceCulture);
    100         return ((System.Drawing.Icon)(obj));
    101       }
    102     }
    103 
    104     internal static System.Drawing.Bitmap File {
    105       get {
    106         object obj = ResourceManager.GetObject("File", resourceCulture);
    107         return ((System.Drawing.Bitmap)(obj));
    108       }
    109     }
    110 
    111     internal static System.Drawing.Icon HeuristicLab {
    112       get {
    113         object obj = ResourceManager.GetObject("HeuristicLab", resourceCulture);
    114         return ((System.Drawing.Icon)(obj));
    115       }
    116     }
    117 
    118     internal static System.Drawing.Bitmap HeuristicLabBanner {
    119       get {
    120         object obj = ResourceManager.GetObject("HeuristicLabBanner", resourceCulture);
    121         return ((System.Drawing.Bitmap)(obj));
    122       }
    123     }
    124 
    125     internal static System.Drawing.Bitmap HeuristicLabLogo {
    126       get {
    127         object obj = ResourceManager.GetObject("HeuristicLabLogo", resourceCulture);
    128         return ((System.Drawing.Bitmap)(obj));
    129       }
    130     }
    131 
    132     internal static System.Drawing.Bitmap Install {
    133       get {
    134         object obj = ResourceManager.GetObject("Install", resourceCulture);
    135         return ((System.Drawing.Bitmap)(obj));
    136       }
    137     }
    138 
    139     internal static System.Drawing.Bitmap Internet {
    140       get {
    141         object obj = ResourceManager.GetObject("Internet", resourceCulture);
    142         return ((System.Drawing.Bitmap)(obj));
    143       }
    144     }
    145 
    146     /// <summary>
    147     ///   Looks up a localized string similar to HeuristicLab is free software: you can redistribute it and/or modify
    148     ///it under the terms of the GNU General Public License as published by
    149     ///the Free Software Foundation, either version 3 of the License, or
    150     ///(at your option) any later version.
    151     ///
    152     ///HeuristicLab is distributed in the hope that it will be useful,
    153     ///but WITHOUT ANY WARRANTY; without even the implied warranty of
    154     ///MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    155     ///GNU General Public License for more details.
    156     ///
    157     ///You should have received a copy of t [rest of string was truncated]&quot;;.
    158     /// </summary>
    159     internal static string LicenseText {
    160       get {
    161         return ResourceManager.GetString("LicenseText", resourceCulture);
    162       }
    163     }
    164 
    165     internal static System.Drawing.Bitmap NetworkConnections {
    166       get {
    167         object obj = ResourceManager.GetObject("NetworkConnections", resourceCulture);
    168         return ((System.Drawing.Bitmap)(obj));
    169       }
    170     }
    171 
    172     internal static System.Drawing.Bitmap Plugin {
    173       get {
    174         object obj = ResourceManager.GetObject("Plugin", resourceCulture);
    175         return ((System.Drawing.Bitmap)(obj));
    176       }
    177     }
    178 
    179     internal static System.Drawing.Bitmap PublishToWeb {
    180       get {
    181         object obj = ResourceManager.GetObject("PublishToWeb", resourceCulture);
    182         return ((System.Drawing.Bitmap)(obj));
    183       }
    184     }
    185 
    186     internal static System.Drawing.Bitmap Remove {
    187       get {
    188         object obj = ResourceManager.GetObject("Remove", resourceCulture);
    189         return ((System.Drawing.Bitmap)(obj));
    190       }
    191     }
    192 
    193     internal static System.Drawing.Bitmap Repeat {
    194       get {
    195         object obj = ResourceManager.GetObject("Repeat", resourceCulture);
    196         return ((System.Drawing.Bitmap)(obj));
    197       }
    198     }
    199 
    200     internal static System.Drawing.Icon Setup_Install {
    201       get {
    202         object obj = ResourceManager.GetObject("Setup_Install", resourceCulture);
    203         return ((System.Drawing.Icon)(obj));
    204       }
    205     }
    206 
    207     internal static System.Drawing.Bitmap ShowDetails {
    208       get {
    209         object obj = ResourceManager.GetObject("ShowDetails", resourceCulture);
    210         return ((System.Drawing.Bitmap)(obj));
    211       }
    212     }
    213 
    214     internal static System.Drawing.Bitmap ShowIcons {
    215       get {
    216         object obj = ResourceManager.GetObject("ShowIcons", resourceCulture);
    217         return ((System.Drawing.Bitmap)(obj));
    218       }
    219     }
    220   }
    221229}
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Resources.resx

    r3831 r6760  
    113113  </resheader>
    114114  <resheader name="reader">
    115     <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     115    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    116116  </resheader>
    117117  <resheader name="writer">
    118     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
    120   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     120  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    121121  <data name="Add" type="System.Resources.ResXFileRef, System.Windows.Forms">
    122122    <value>Resources\VS2008ImageLibrary_CommonElements_Actions_Add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     
    194194    <value>Resources\show_icons.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    195195  </data>
     196  <data name="UpdateAvailable" type="System.Resources.ResXFileRef, System.Windows.Forms">
     197    <value>resources\updateavailable.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     198  </data>
    196199</root>
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs

    r6174 r6760  
    132132    }
    133133
    134     /// <summary>
    135     /// Loads raw assemblies dynamically from a byte array
    136     /// </summary>
    137     /// <param name="assemblies">bytearray of all raw assemblies that should be loaded</param>
    138     internal void LoadAssemblies(IEnumerable<byte[]> assemblies) {
    139       foreach (byte[] asm in assemblies) {
    140         Assembly loadedAsm = Assembly.Load(asm);
    141         RegisterLoadedAssembly(loadedAsm);
    142       }
    143     }
    144 
    145134    // register assembly in the assembly cache for the AssemblyResolveEvent
    146135    private void RegisterLoadedAssembly(Assembly asm) {
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Sandboxing/SandboxManager.cs

    r6174 r6760  
    2525using System.Security.Permissions;
    2626using HeuristicLab.PluginInfrastructure.Manager;
     27using System.IO;
    2728
    2829namespace HeuristicLab.PluginInfrastructure.Sandboxing {
     
    6768      pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.UnmanagedCode));
    6869      pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.SerializationFormatter));
    69       pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.ControlAppDomain));
    7070      //needed for HeuristicLab.Persistence, see DynamicMethod Constructor (String, Type, array<Type []()>[], Type, Boolean)
    7171      pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.ControlEvidence));
    72 
    73       ReflectionPermission refPerm = new ReflectionPermission(PermissionState.Unrestricted);
    74       pSet.AddPermission(refPerm);
     72      pSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted));
    7573
    7674      FileIOPermission ioPerm = new FileIOPermission(PermissionState.None);
    7775      //allow path discovery for system drive, needed by HeuristicLab.Persistence: Serializer.BuildTypeCache() -> Assembly.CodeBase
    78       ioPerm.AddPathList(FileIOPermissionAccess.PathDiscovery, Environment.SystemDirectory.Substring(0, 3));
     76      ioPerm.AddPathList(FileIOPermissionAccess.PathDiscovery, Path.GetPathRoot(Path.GetFullPath(Environment.SystemDirectory)));
    7977      //allow full access to the appdomain's base directory
    8078      ioPerm.AddPathList(FileIOPermissionAccess.AllAccess, applicationBase);
  • branches/PersistenceSpeedUp/HeuristicLab.PluginInfrastructure/3.3/Starter/StarterForm.cs

    r5445 r6760  
    2929using HeuristicLab.PluginInfrastructure.Advanced;
    3030using HeuristicLab.PluginInfrastructure.Manager;
     31using System.Threading.Tasks;
    3132
    3233namespace HeuristicLab.PluginInfrastructure.Starter {
     
    3637  /// </summary>
    3738  public partial class StarterForm : Form {
     39    private const string pluginManagerItemName = "Plugin Manager";
     40    private const string updatePluginsItemName = "Updates Available";
     41
    3842
    3943    private ListViewItem pluginManagerListViewItem;
     
    4145    private PluginManager pluginManager;
    4246    private SplashScreen splashScreen;
    43 
     47    private bool updatesAvailable = false;
    4448    /// <summary>
    4549    /// Initializes an instance of the starter form.
     
    5054      InitializeComponent();
    5155      largeImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.HeuristicLab.ToBitmap());
     56      largeImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.UpdateAvailable.ToBitmap());
    5257      smallImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.HeuristicLab.ToBitmap());
     58      smallImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.UpdateAvailable.ToBitmap());
    5359      FileVersionInfo pluginInfrastructureVersion = FileVersionInfo.GetVersionInfo(GetType().Assembly.Location);
    5460      Text = "HeuristicLab " + pluginInfrastructureVersion.FileVersion;
     
    6167      pluginManager.DiscoverAndCheckPlugins();
    6268      UpdateApplicationsList();
     69
     70      CheckUpdatesAvailableAsync();
     71    }
     72
     73    private void CheckUpdatesAvailableAsync() {
     74      string pluginPath = Path.GetFullPath(Application.StartupPath);
     75      var task = Task.Factory.StartNew<bool>(() => {
     76        var installationManager = new InstallationManager(pluginPath);
     77        IEnumerable<IPluginDescription> installedPlugins = pluginManager.Plugins.OfType<IPluginDescription>();
     78        var remotePlugins = installationManager.GetRemotePluginList();
     79        // if there is a local plugin with same name and same major and minor version then it's an update
     80        var pluginsToUpdate = from remotePlugin in remotePlugins
     81                              let matchingLocalPlugins = from installedPlugin in installedPlugins
     82                                                         where installedPlugin.Name == remotePlugin.Name
     83                                                         where installedPlugin.Version.Major == remotePlugin.Version.Major
     84                                                         where installedPlugin.Version.Minor == remotePlugin.Version.Minor
     85                                                         where Util.IsNewerThan(remotePlugin, installedPlugin)
     86                                                         select installedPlugin
     87                              where matchingLocalPlugins.Count() > 0
     88                              select remotePlugin;
     89        return pluginsToUpdate.Count() > 0;
     90      });
     91      task.ContinueWith(t => {
     92        try {
     93          t.Wait();
     94          updatesAvailable = t.Result;
     95          UpdateApplicationsList();
     96        }
     97        catch (AggregateException ae) {
     98          ae.Handle(ex => {
     99            if (ex is InstallationManagerException) {
     100              // this is expected when no internet connection is available => do nothing
     101              return true;
     102            } else {
     103              return false;
     104            }
     105          });
     106        }
     107      });
    63108    }
    64109
     
    85130      if (applicationsListView.SelectedItems.Count > 0) {
    86131        ListViewItem selected = applicationsListView.SelectedItems[0];
    87         if (selected == pluginManagerListViewItem) {
     132        if (selected.Text == pluginManagerItemName) {
    88133          if (pluginManager.Plugins.Any(x => x.PluginState == PluginState.Loaded)) {
    89134            MessageBox.Show("Installation Manager cannot be started while another HeuristicLab application is active." + Environment.NewLine +
     
    102147            }
    103148          }
     149        } else if (selected.Text == updatePluginsItemName) {
     150          if (pluginManager.Plugins.Any(x => x.PluginState == PluginState.Loaded)) {
     151            MessageBox.Show("Updating is not possible while another HeuristicLab application is active." + Environment.NewLine +
     152              "Please stop all active HeuristicLab applications and try again.", "Update plugins",
     153              MessageBoxButtons.OK, MessageBoxIcon.Information);
     154          } else {
     155            try {
     156              Cursor = Cursors.AppStarting;
     157              using (PluginUpdaterForm form = new PluginUpdaterForm(pluginManager)) {
     158                form.ShowDialog(this);
     159              }
     160              updatesAvailable = false;
     161              CheckUpdatesAvailableAsync();
     162              UpdateApplicationsList();
     163            }
     164            finally {
     165              Cursor = Cursors.Arrow;
     166            }
     167          }
    104168        } else {
    105169          ApplicationDescription app = (ApplicationDescription)applicationsListView.SelectedItems[0].Tag;
     
    110174
    111175    private void UpdateApplicationsList() {
    112       applicationsListView.Items.Clear();
     176      if (InvokeRequired) Invoke((Action)UpdateApplicationsList);
     177      else {
     178        applicationsListView.Items.Clear();
     179        AddPluginManagerItem();
     180        AddUpdatePluginsItem();
     181
     182        foreach (ApplicationDescription info in pluginManager.Applications) {
     183          ListViewItem item = new ListViewItem(info.Name, 0);
     184          item.Tag = info;
     185          item.Group = applicationsListView.Groups["Applications"];
     186          item.SubItems.Add(new ListViewItem.ListViewSubItem(item, info.Version.ToString()));
     187          item.SubItems.Add(new ListViewItem.ListViewSubItem(item, info.Description));
     188          item.ToolTipText = info.Description;
     189          applicationsListView.Items.Add(item);
     190        }
     191        foreach (ColumnHeader column in applicationsListView.Columns) {
     192          if (applicationsListView.Items.Count > 0)
     193            column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
     194          else column.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
     195        }
     196      }
     197    }
     198
     199    private void AddPluginManagerItem() {
    113200      FileVersionInfo pluginInfrastructureVersion = FileVersionInfo.GetVersionInfo(GetType().Assembly.Location);
    114       pluginManagerListViewItem = new ListViewItem("Plugin Manager", 0);
     201      pluginManagerListViewItem = new ListViewItem(pluginManagerItemName, 0);
    115202      pluginManagerListViewItem.Group = applicationsListView.Groups["Plugin Management"];
    116203      pluginManagerListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(pluginManagerListViewItem, pluginInfrastructureVersion.FileVersion));
     
    119206
    120207      applicationsListView.Items.Add(pluginManagerListViewItem);
    121 
    122       foreach (ApplicationDescription info in pluginManager.Applications) {
    123         ListViewItem item = new ListViewItem(info.Name, 0);
    124         item.Tag = info;
    125         item.Group = applicationsListView.Groups["Applications"];
    126         item.SubItems.Add(new ListViewItem.ListViewSubItem(item, info.Version.ToString()));
    127         item.SubItems.Add(new ListViewItem.ListViewSubItem(item, info.Description));
    128         item.ToolTipText = info.Description;
    129         applicationsListView.Items.Add(item);
    130       }
    131       foreach (ColumnHeader column in applicationsListView.Columns) {
    132         if (applicationsListView.Items.Count > 0)
    133           column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
    134         else column.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
     208    }
     209
     210    private void AddUpdatePluginsItem() {
     211      if (updatesAvailable) {
     212        var updateListViewItem = new ListViewItem(updatePluginsItemName, 1);
     213        updateListViewItem.Group = applicationsListView.Groups["Plugin Management"];
     214        updateListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(updateListViewItem, ""));
     215        updateListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(updateListViewItem, "Download and install updates"));
     216        updateListViewItem.ToolTipText = "Download and install updates";
     217
     218        applicationsListView.Items.Add(updateListViewItem);
    135219      }
    136220    }
Note: See TracChangeset for help on using the changeset viewer.