Changeset 2753 for trunk/sources
- Timestamp:
- 02/04/10 13:13:16 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/Advanced
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManager.cs
r2690 r2753 41 41 internal event EventHandler<PluginInfrastructureEventArgs> PluginInstalled; 42 42 43 44 public IEnumerable<PluginDescription> Plugins { 45 get { return pluginManager.Plugins; } 46 } 47 43 48 private string pluginDir; 44 49 private string updateLocationUrl; … … 66 71 builder.Append("Version: ").AppendLine(desc.Version.ToString()); 67 72 builder.AppendLine("Description:").AppendLine(desc.Description); 68 builder.Append("Build date: ").AppendLine(desc.BuildDate.ToString()); 73 builder.AppendLine("This plugin is " + desc.PluginState.ToString().ToLowerInvariant() + "."); 74 builder.Append("Build date: ").AppendLine(desc.BuildDate.ToString()).AppendLine(); 69 75 builder.AppendLine("Files: "); 70 foreach ( string fileName in from file in desc.Files select file.Name) {71 builder.AppendLine(file Name);72 } 73 builder.AppendLine( "Directly depends on:");76 foreach (var file in desc.Files) { 77 builder.AppendLine(file.Type + " " + file.Name); 78 } 79 builder.AppendLine().AppendLine("Directly depends on:"); 74 80 if (desc.Dependencies.Count() == 0) builder.AppendLine("None"); 75 81 foreach (var dependency in desc.Dependencies) { 76 builder.AppendLine(dependency.Name );77 } 78 builder.Append Format("Plugins directly dependent on {0}:\n", desc.Name);82 builder.AppendLine(dependency.Name + " " + dependency.Version); 83 } 84 builder.AppendLine().AppendFormat("Plugins directly dependent on {0}:\n", desc.Name); 79 85 var dependents = from x in pluginManager.Plugins 80 86 where x.Dependencies.Contains(desc) 81 select x .Name;87 select x; 82 88 if (dependents.Count() == 0) builder.AppendLine("None"); 83 89 foreach (var dependent in dependents) { 84 builder.AppendLine(dependent );85 } 86 builder.AppendLine( "This plugin is " + desc.PluginState.ToString().ToLowerInvariant() + ".");90 builder.AppendLine(dependent.Name + " " + dependent.Version); 91 } 92 builder.AppendLine(); 87 93 if (desc.PluginState == PluginState.Disabled) { 88 94 builder.AppendLine(DetermineProblem(desc)); … … 95 101 // either any file is missing 96 102 StringBuilder builder = new StringBuilder(); 103 builder.AppendLine("Problem report:"); 97 104 var missingFiles = from x in desc.Files 98 105 where !File.Exists(x.Name) -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.Designer.cs
r2748 r2753 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.statusStrip = new System.Windows.Forms.StatusStrip(); 27 this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 28 this.detailsTextBox = new System.Windows.Forms.TextBox(); 29 this.pluginsListView = new System.Windows.Forms.ListView(); 30 this.tableLayoutPanel.SuspendLayout(); 26 31 this.SuspendLayout(); 32 // 33 // statusStrip 34 // 35 this.statusStrip.Location = new System.Drawing.Point(0, 433); 36 this.statusStrip.Name = "statusStrip"; 37 this.statusStrip.Size = new System.Drawing.Size(394, 22); 38 this.statusStrip.TabIndex = 0; 39 this.statusStrip.Text = "statusStrip1"; 40 // 41 // tableLayoutPanel 42 // 43 this.tableLayoutPanel.ColumnCount = 1; 44 this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); 45 this.tableLayoutPanel.Controls.Add(this.detailsTextBox, 0, 1); 46 this.tableLayoutPanel.Controls.Add(this.pluginsListView, 0, 0); 47 this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; 48 this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0); 49 this.tableLayoutPanel.Name = "tableLayoutPanel"; 50 this.tableLayoutPanel.RowCount = 2; 51 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 64F)); 52 this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 36F)); 53 this.tableLayoutPanel.Size = new System.Drawing.Size(394, 433); 54 this.tableLayoutPanel.TabIndex = 1; 55 // 56 // detailsTextBox 57 // 58 this.detailsTextBox.Dock = System.Windows.Forms.DockStyle.Fill; 59 this.detailsTextBox.Location = new System.Drawing.Point(3, 280); 60 this.detailsTextBox.Multiline = true; 61 this.detailsTextBox.Name = "detailsTextBox"; 62 this.detailsTextBox.ReadOnly = true; 63 this.detailsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 64 this.detailsTextBox.Size = new System.Drawing.Size(388, 150); 65 this.detailsTextBox.TabIndex = 0; 66 // 67 // pluginsListView 68 // 69 this.pluginsListView.Dock = System.Windows.Forms.DockStyle.Fill; 70 this.pluginsListView.Location = new System.Drawing.Point(3, 3); 71 this.pluginsListView.MultiSelect = false; 72 this.pluginsListView.Name = "pluginsListView"; 73 this.pluginsListView.Size = new System.Drawing.Size(388, 271); 74 this.pluginsListView.TabIndex = 1; 75 this.pluginsListView.UseCompatibleStateImageBehavior = false; 76 this.pluginsListView.View = System.Windows.Forms.View.List; 77 this.pluginsListView.SelectedIndexChanged += new System.EventHandler(this.pluginsListView_SelectedIndexChanged); 27 78 // 28 79 // InstallationManagerForm … … 30 81 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 31 82 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 32 this.ClientSize = new System.Drawing.Size(284, 264); 83 this.ClientSize = new System.Drawing.Size(394, 455); 84 this.Controls.Add(this.tableLayoutPanel); 85 this.Controls.Add(this.statusStrip); 33 86 this.Name = "InstallationManagerForm"; 34 87 this.Text = "InstallationManager"; 88 this.tableLayoutPanel.ResumeLayout(false); 89 this.tableLayoutPanel.PerformLayout(); 35 90 this.ResumeLayout(false); 91 this.PerformLayout(); 36 92 37 93 } 38 94 39 95 #endregion 96 97 private System.Windows.Forms.StatusStrip statusStrip; 98 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 99 private System.Windows.Forms.TextBox detailsTextBox; 100 private System.Windows.Forms.ListView pluginsListView; 40 101 } 41 102 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.cs
r2748 r2753 7 7 using System.Text; 8 8 using System.Windows.Forms; 9 using System.IO; 10 using HeuristicLab.PluginInfrastructure.Manager; 9 11 10 12 namespace HeuristicLab.PluginInfrastructure.Advanced { 11 13 public partial class InstallationManagerForm : Form { 14 private InstallationManager installationManager; 15 12 16 public InstallationManagerForm() { 13 17 InitializeComponent(); 18 this.installationManager = new InstallationManager(Path.GetDirectoryName(Application.ExecutablePath)); 19 20 UpdatePluginsList(); 21 } 22 23 private void UpdatePluginsList() { 24 foreach (var plugin in installationManager.Plugins) { 25 pluginsListView.Items.Add(CreatePluginItem(plugin)); 26 } 27 } 28 29 private static ListViewItem CreatePluginItem(IPluginDescription plugin) { 30 ListViewItem item = new ListViewItem(); 31 item.Tag = plugin; 32 item.Text = plugin.Name + "-" + plugin.Version.ToString(); 33 return item; 34 } 35 36 private void pluginsListView_SelectedIndexChanged(object sender, EventArgs e) { 37 if (pluginsListView.SelectedItems.Count > 0) { 38 ListViewItem selecteditem = pluginsListView.SelectedItems[0]; 39 IPluginDescription desc = (IPluginDescription)selecteditem.Tag; 40 UpdateDetailsBox((PluginDescription)desc); 41 } 42 } 43 44 private void UpdateDetailsBox(PluginDescription desc) { 45 detailsTextBox.Text = installationManager.GetInformation(desc.Name); 14 46 } 15 47 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.resx
r2748 r2753 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>17, 17</value> 122 </metadata> 120 123 </root>
Note: See TracChangeset
for help on using the changeset viewer.