Changeset 13335


Ignore:
Timestamp:
11/23/15 12:19:20 (4 years ago)
Author:
gkronber
Message:

#2522: removed IStatusDisplay and PluginInfrastructureCancelEventArgs

Location:
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerControl.cs

    r12012 r13335  
    2323namespace HeuristicLab.PluginInfrastructure.Advanced {
    2424  internal partial class InstallationManagerControl : UserControl {
    25     private IStatusView statusView;
    26     public IStatusView StatusView {
    27       get { return statusView; }
    28       set { statusView = value; }
    29     }
    3025
    3126    public InstallationManagerControl()
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.Designer.cs

    r13333 r13335  
    119119      this.localPluginsView.PluginManager = null;
    120120      this.localPluginsView.Size = new System.Drawing.Size(578, 354);
    121       this.localPluginsView.StatusView = null;
    122121      this.localPluginsView.TabIndex = 0;
    123122      //
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs

    r13333 r13335  
    2020#endregion
    2121using System;
    22 using System.Collections.Generic;
    23 using System.ComponentModel;
    24 using System.IO;
    25 using System.Linq;
    26 using System.Text;
    2722using System.Windows.Forms;
    2823using HeuristicLab.PluginInfrastructure.Manager;
    2924
    3025namespace HeuristicLab.PluginInfrastructure.Advanced {
    31   internal partial class InstallationManagerForm : Form, IStatusView {
     26  internal partial class InstallationManagerForm : Form {
    3227    private string pluginDir;
    3328
     
    3732      Text = "HeuristicLab Plugin Manager " + AssemblyHelpers.GetFileVersion(GetType().Assembly);
    3833
    39       pluginManager.PluginLoaded += pluginManager_PluginLoaded;
    40       pluginManager.PluginUnloaded += pluginManager_PluginUnloaded;
    41       pluginManager.Initializing += pluginManager_Initializing;
    42       pluginManager.Initialized += pluginManager_Initialized;
    43 
    4434      pluginDir = Application.StartupPath;
    4535
    46       localPluginsView.StatusView = this;
    4736      localPluginsView.PluginManager = pluginManager;
    4837      // localPluginsView.InstallationManager = installationManager;
    4938    }
    50 
    51 
    52     #region plugin manager event handlers
    53     private void pluginManager_Initialized(object sender, PluginInfrastructureEventArgs e) {
    54       SetStatusStrip("Initialized PluginInfrastructure");
    55     }
    56 
    57     private void pluginManager_Initializing(object sender, PluginInfrastructureEventArgs e) {
    58       SetStatusStrip("Initializing PluginInfrastructure");
    59     }
    60 
    61     private void pluginManager_PluginUnloaded(object sender, PluginInfrastructureEventArgs e) {
    62       SetStatusStrip("Unloaded " + e.Entity);
    63     }
    64 
    65     private void pluginManager_PluginLoaded(object sender, PluginInfrastructureEventArgs e) {
    66       SetStatusStrip("Loaded " + e.Entity);
    67     }
    68     #endregion
    69 
    7039
    7140    #region button events
     
    7443    }
    7544    #endregion
    76 
    77     #region helper methods
    78     private void SetStatusStrip(string msg) {
    79       if (InvokeRequired) Invoke((Action<string>)SetStatusStrip, msg);
    80       else {
    81         toolStripStatusLabel.Text = msg;
    82         logTextBox.Text += DateTime.Now + ": " + msg + Environment.NewLine;
    83       }
    84     }
    85 
    86     #endregion
    87 
    88 
    89     #region IStatusView Members
    90 
    91     public void ShowProgressIndicator(double percentProgress) {
    92       if (percentProgress < 0.0 || percentProgress > 1.0) throw new ArgumentException("percentProgress");
    93       toolStripProgressBar.Visible = true;
    94       toolStripProgressBar.Style = ProgressBarStyle.Continuous;
    95       int range = toolStripProgressBar.Maximum - toolStripProgressBar.Minimum;
    96       toolStripProgressBar.Value = (int)(percentProgress * range + toolStripProgressBar.Minimum);
    97     }
    98 
    99     public void ShowProgressIndicator() {
    100       toolStripProgressBar.Visible = true;
    101       toolStripProgressBar.Style = ProgressBarStyle.Marquee;
    102     }
    103 
    104     public void HideProgressIndicator() {
    105       toolStripProgressBar.Visible = false;
    106     }
    107 
    108     public void ShowMessage(string message) {
    109       if (string.IsNullOrEmpty(toolStripStatusLabel.Text))
    110         toolStripStatusLabel.Text = message;
    111       else
    112         toolStripStatusLabel.Text += "; " + message;
    113     }
    114 
    115     public void RemoveMessage(string message) {
    116       if (toolStripStatusLabel.Text.IndexOf("; " + message) > 0) {
    117         toolStripStatusLabel.Text = toolStripStatusLabel.Text.Replace("; " + message, "");
    118       }
    119       toolStripStatusLabel.Text = toolStripStatusLabel.Text.Replace(message, "");
    120       toolStripStatusLabel.Text = toolStripStatusLabel.Text.TrimStart(' ', ';');
    121     }
    122     public void LockUI() {
    123       Cursor = Cursors.AppStarting;
    124       tabControl.Enabled = false;
    125     }
    126     public void UnlockUI() {
    127       tabControl.Enabled = true;
    128       Cursor = Cursors.Default;
    129     }
    130     public void ShowError(string shortMessage, string description) {
    131       logTextBox.Text += DateTime.Now + ": " + shortMessage + Environment.NewLine + description + Environment.NewLine;
    132       MessageBox.Show(description, shortMessage);
    133     }
    134     #endregion
    135 
    13645  }
    13746}
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Advanced/Util.cs

    r12012 r13335  
    3939        ResizeColumn(columnHeader);
    4040    }
    41 
    42     internal static IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin, IEnumerable<IPluginDescription> availablePlugins) {
    43       return from p in availablePlugins
    44              let matchingEntries = from dep in GetAllDependencies(p)
    45                                    where dep.Name == plugin.Name
    46                                    where dep.Version == plugin.Version
    47                                    select dep
    48              where matchingEntries.Any()
    49              select p as IPluginDescription;
    50     }
    51 
    52     internal static IEnumerable<IPluginDescription> GetAllDependencies(IPluginDescription plugin) {
    53       HashSet<IPluginDescription> yieldedPlugins = new HashSet<IPluginDescription>();
    54       foreach (var dep in plugin.Dependencies) {
    55         foreach (var recDep in GetAllDependencies(dep)) {
    56           if (!yieldedPlugins.Contains(recDep)) {
    57             yieldedPlugins.Add(recDep);
    58             yield return recDep;
    59           }
    60         }
    61         if (!yieldedPlugins.Contains(dep)) {
    62           yieldedPlugins.Add(dep);
    63           yield return dep;
    64         }
    65       }
    66     }
    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     }
    7441  }
    7542}
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj

    r13334 r13335  
    139139      <DependentUpon>InstalledPluginsView.cs</DependentUpon>
    140140    </Compile>
    141     <Compile Include="Advanced\IStatusDisplay.cs">
    142       <SubType>Code</SubType>
    143     </Compile>
    144141    <Compile Include="Advanced\LicenseView.cs">
    145142      <SubType>Form</SubType>
     
    210207    <Compile Include="Manager\ApplicationDescription.cs" />
    211208    <Compile Include="Manager\PluginFile.cs" />
    212     <Compile Include="Manager\PluginInfrastructureCancelEventArgs.cs" />
    213209    <Compile Include="Manager\PluginDescription.cs" />
    214210    <Compile Include="Manager\PluginInfrastructureEventArgs.cs" />
     
    286282    </BootstrapperPackage>
    287283  </ItemGroup>
    288   <ItemGroup>
    289     <Folder Include="Advanced\DeploymentService\" />
    290   </ItemGroup>
     284  <ItemGroup />
    291285  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    292286  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Sandboxing/SandboxManager.cs

    r12927 r13335  
    2727
    2828namespace HeuristicLab.PluginInfrastructure.Sandboxing {
     29  // used by Hive Slave
    2930  public static class SandboxManager {
    3031    /// <summary>
Note: See TracChangeset for help on using the changeset viewer.