Changeset 13335
- Timestamp:
- 11/23/15 12:19:20 (9 years ago)
- 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 23 23 namespace HeuristicLab.PluginInfrastructure.Advanced { 24 24 internal partial class InstallationManagerControl : UserControl { 25 private IStatusView statusView;26 public IStatusView StatusView {27 get { return statusView; }28 set { statusView = value; }29 }30 25 31 26 public InstallationManagerControl() -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.Designer.cs
r13333 r13335 119 119 this.localPluginsView.PluginManager = null; 120 120 this.localPluginsView.Size = new System.Drawing.Size(578, 354); 121 this.localPluginsView.StatusView = null;122 121 this.localPluginsView.TabIndex = 0; 123 122 // -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs
r13333 r13335 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic;23 using System.ComponentModel;24 using System.IO;25 using System.Linq;26 using System.Text;27 22 using System.Windows.Forms; 28 23 using HeuristicLab.PluginInfrastructure.Manager; 29 24 30 25 namespace HeuristicLab.PluginInfrastructure.Advanced { 31 internal partial class InstallationManagerForm : Form , IStatusView{26 internal partial class InstallationManagerForm : Form { 32 27 private string pluginDir; 33 28 … … 37 32 Text = "HeuristicLab Plugin Manager " + AssemblyHelpers.GetFileVersion(GetType().Assembly); 38 33 39 pluginManager.PluginLoaded += pluginManager_PluginLoaded;40 pluginManager.PluginUnloaded += pluginManager_PluginUnloaded;41 pluginManager.Initializing += pluginManager_Initializing;42 pluginManager.Initialized += pluginManager_Initialized;43 44 34 pluginDir = Application.StartupPath; 45 35 46 localPluginsView.StatusView = this;47 36 localPluginsView.PluginManager = pluginManager; 48 37 // localPluginsView.InstallationManager = installationManager; 49 38 } 50 51 52 #region plugin manager event handlers53 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 #endregion69 70 39 71 40 #region button events … … 74 43 } 75 44 #endregion 76 77 #region helper methods78 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 #endregion87 88 89 #region IStatusView Members90 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 else112 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 #endregion135 136 45 } 137 46 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Advanced/Util.cs
r12012 r13335 39 39 ResizeColumn(columnHeader); 40 40 } 41 42 internal static IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin, IEnumerable<IPluginDescription> availablePlugins) {43 return from p in availablePlugins44 let matchingEntries = from dep in GetAllDependencies(p)45 where dep.Name == plugin.Name46 where dep.Version == plugin.Version47 select dep48 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 plugin269 internal static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {70 // newer: build version is higher, or if build version is the same revision is higher71 return plugin1.Version.Build > plugin2.Version.Build ||72 (plugin1.Version.Build == plugin2.Version.Build && plugin1.Version.Revision > plugin2.Version.Revision);73 }74 41 } 75 42 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj
r13334 r13335 139 139 <DependentUpon>InstalledPluginsView.cs</DependentUpon> 140 140 </Compile> 141 <Compile Include="Advanced\IStatusDisplay.cs">142 <SubType>Code</SubType>143 </Compile>144 141 <Compile Include="Advanced\LicenseView.cs"> 145 142 <SubType>Form</SubType> … … 210 207 <Compile Include="Manager\ApplicationDescription.cs" /> 211 208 <Compile Include="Manager\PluginFile.cs" /> 212 <Compile Include="Manager\PluginInfrastructureCancelEventArgs.cs" />213 209 <Compile Include="Manager\PluginDescription.cs" /> 214 210 <Compile Include="Manager\PluginInfrastructureEventArgs.cs" /> … … 286 282 </BootstrapperPackage> 287 283 </ItemGroup> 288 <ItemGroup> 289 <Folder Include="Advanced\DeploymentService\" /> 290 </ItemGroup> 284 <ItemGroup /> 291 285 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 292 286 <!-- 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 27 27 28 28 namespace HeuristicLab.PluginInfrastructure.Sandboxing { 29 // used by Hive Slave 29 30 public static class SandboxManager { 30 31 /// <summary>
Note: See TracChangeset
for help on using the changeset viewer.