Changeset 13363 for branches/RefactorPluginInfrastructure-2522
- Timestamp:
- 11/24/15 16:34:17 (9 years ago)
- Location:
- branches/RefactorPluginInfrastructure-2522
- Files:
-
- 13 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.Designer.cs
r13338 r13363 47 47 this.components = new System.ComponentModel.Container(); 48 48 this.okButton = new System.Windows.Forms.Button(); 49 this.pluginListView = new System.Windows.Forms.ListView();50 this.pluginNameColumnHeader = new System.Windows.Forms.ColumnHeader();51 this.pluginVersionColumnHeader = new System.Windows.Forms.ColumnHeader();52 this.pluginDescriptionColumnHeader = new System.Windows.Forms.ColumnHeader();53 49 this.imageList = new System.Windows.Forms.ImageList(this.components); 54 50 this.pictureBox = new System.Windows.Forms.PictureBox(); … … 59 55 this.versionTextBox = new System.Windows.Forms.TextBox(); 60 56 this.copyrightTextBox = new System.Windows.Forms.TextBox(); 61 this.pluginsGroupBox = new System.Windows.Forms.GroupBox();62 57 this.licenseTextBox = new System.Windows.Forms.RichTextBox(); 63 58 this.label2 = new System.Windows.Forms.Label(); … … 66 61 this.webLinkLabel = new System.Windows.Forms.LinkLabel(); 67 62 this.mailLinkLabel = new System.Windows.Forms.LinkLabel(); 63 this.showPluginsButton = new System.Windows.Forms.Button(); 68 64 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); 69 this.pluginsGroupBox.SuspendLayout();70 65 this.panel1.SuspendLayout(); 71 66 this.SuspendLayout(); … … 83 78 this.okButton.Click += new System.EventHandler(this.okButton_Click); 84 79 // 85 // pluginListView86 //87 this.pluginListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)88 | System.Windows.Forms.AnchorStyles.Left)89 | System.Windows.Forms.AnchorStyles.Right)));90 this.pluginListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {91 this.pluginNameColumnHeader,92 this.pluginVersionColumnHeader,93 this.pluginDescriptionColumnHeader});94 this.pluginListView.Location = new System.Drawing.Point(6, 19);95 this.pluginListView.Name = "pluginListView";96 this.pluginListView.ShowGroups = false;97 this.pluginListView.Size = new System.Drawing.Size(589, 201);98 this.pluginListView.SmallImageList = this.imageList;99 this.pluginListView.Sorting = System.Windows.Forms.SortOrder.Ascending;100 this.pluginListView.TabIndex = 0;101 this.pluginListView.UseCompatibleStateImageBehavior = false;102 this.pluginListView.View = System.Windows.Forms.View.Details;103 this.pluginListView.ItemActivate += new System.EventHandler(this.pluginListView_ItemActivate);104 //105 // pluginNameColumnHeader106 //107 this.pluginNameColumnHeader.Text = "Name";108 //109 // pluginVersionColumnHeader110 //111 this.pluginVersionColumnHeader.Text = "Version";112 //113 // pluginDescriptionColumnHeader114 //115 this.pluginDescriptionColumnHeader.Text = "Description";116 //117 80 // imageList 118 81 // … … 191 154 this.copyrightTextBox.Text = "(C)"; 192 155 // 193 // pluginsGroupBox194 //195 this.pluginsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)196 | System.Windows.Forms.AnchorStyles.Left)197 | System.Windows.Forms.AnchorStyles.Right)));198 this.pluginsGroupBox.Controls.Add(this.pluginListView);199 this.pluginsGroupBox.Location = new System.Drawing.Point(12, 306);200 this.pluginsGroupBox.Name = "pluginsGroupBox";201 this.pluginsGroupBox.Size = new System.Drawing.Size(601, 226);202 this.pluginsGroupBox.TabIndex = 12;203 this.pluginsGroupBox.TabStop = false;204 this.pluginsGroupBox.Text = "Plugins";205 //206 156 // licenseTextBox 207 157 // 208 this.licenseTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 209 158 this.licenseTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 159 | System.Windows.Forms.AnchorStyles.Right))); 210 160 this.licenseTextBox.BackColor = System.Drawing.SystemColors.HighlightText; 211 161 this.licenseTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; … … 230 180 // panel1 231 181 // 232 this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 233 182 this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 183 | System.Windows.Forms.AnchorStyles.Right))); 234 184 this.panel1.BackColor = System.Drawing.SystemColors.Control; 235 185 this.panel1.Controls.Add(this.okButton); 236 this.panel1.Location = new System.Drawing.Point(0, 538);186 this.panel1.Location = new System.Drawing.Point(0, 388); 237 187 this.panel1.Name = "panel1"; 238 188 this.panel1.Size = new System.Drawing.Size(626, 48); … … 270 220 this.mailLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.mailLinkLabel_LinkClicked); 271 221 // 222 // showPluginsButton 223 // 224 this.showPluginsButton.Location = new System.Drawing.Point(12, 198); 225 this.showPluginsButton.Name = "showPluginsButton"; 226 this.showPluginsButton.Size = new System.Drawing.Size(102, 23); 227 this.showPluginsButton.TabIndex = 12; 228 this.showPluginsButton.Text = "Show Plugins"; 229 this.showPluginsButton.UseVisualStyleBackColor = true; 230 this.showPluginsButton.Click += new System.EventHandler(this.showPluginsButton_Click); 231 // 272 232 // AboutDialog 273 233 // 274 234 this.AcceptButton = this.okButton; 275 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);276 235 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 277 236 this.BackColor = System.Drawing.SystemColors.Window; 278 237 this.CancelButton = this.okButton; 279 this.ClientSize = new System.Drawing.Size(625, 586); 238 this.ClientSize = new System.Drawing.Size(625, 436); 239 this.Controls.Add(this.showPluginsButton); 280 240 this.Controls.Add(this.mailLinkLabel); 281 241 this.Controls.Add(this.webLinkLabel); … … 284 244 this.Controls.Add(this.label2); 285 245 this.Controls.Add(this.licenseTextBox); 286 this.Controls.Add(this.pluginsGroupBox);287 246 this.Controls.Add(this.copyrightTextBox); 288 247 this.Controls.Add(this.versionTextBox); … … 292 251 this.Controls.Add(this.label); 293 252 this.Controls.Add(this.pictureBox); 294 this.Icon = Resources.HeuristicLab;253 this.Icon = global::HeuristicLab.PluginInfrastructure.UI.Resources.HeuristicLab; 295 254 this.MaximizeBox = false; 296 255 this.MinimizeBox = false; … … 299 258 this.Text = "About HeuristicLab"; 300 259 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); 301 this.pluginsGroupBox.ResumeLayout(false);302 260 this.panel1.ResumeLayout(false); 303 261 this.ResumeLayout(false); … … 309 267 310 268 private System.Windows.Forms.Button okButton; 311 private System.Windows.Forms.ListView pluginListView;312 269 private System.Windows.Forms.ImageList imageList; 313 private System.Windows.Forms.ColumnHeader pluginNameColumnHeader;314 private System.Windows.Forms.ColumnHeader pluginVersionColumnHeader;315 private System.Windows.Forms.ColumnHeader pluginDescriptionColumnHeader;316 270 private System.Windows.Forms.PictureBox pictureBox; 317 271 private System.Windows.Forms.Label label; … … 321 275 private System.Windows.Forms.TextBox versionTextBox; 322 276 private System.Windows.Forms.TextBox copyrightTextBox; 323 private System.Windows.Forms.GroupBox pluginsGroupBox;324 277 private System.Windows.Forms.RichTextBox licenseTextBox; 325 278 private System.Windows.Forms.Label label2; … … 328 281 private System.Windows.Forms.LinkLabel webLinkLabel; 329 282 private System.Windows.Forms.LinkLabel mailLinkLabel; 283 private System.Windows.Forms.Button showPluginsButton; 330 284 } 331 285 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.cs
r13353 r13363 31 31 /// </summary> 32 32 public partial class AboutDialog : Form { 33 private List<IPluginDescription> plugins; 34 33 35 /// <summary> 34 /// Creates a new about dialog with all plugins loaded in the current application.36 /// Creates a new about dialog listing all plugins in the <paramref name="plugins"/> enumerable. 35 37 /// </summary> 36 public AboutDialog() { 38 /// <param name="plugins">Enumerable of plugins that should be listed.</param> 39 public AboutDialog(IEnumerable<IPluginDescription> plugins) { 37 40 InitializeComponent(); 38 41 var entryAssembly = Assembly.GetEntryAssembly(); … … 43 46 pictureBox.Image = Resources.HeuristicLabLogo; 44 47 licenseTextBox.Text = Resources.LicenseText; 45 UpdatePluginList(ApplicationManager.Manager.Plugins);48 this.plugins = plugins.ToList(); 46 49 ActiveControl = okButton; 47 50 } 48 51 49 52 /// <summary> 50 /// Creates a new about dialog listing all plugins in the <paramref name="plugins"/> enumerable.53 /// Creates a new about dialog with all plugins loaded in the current application. 51 54 /// </summary> 52 /// <param name="plugins">Enumerable of plugins that should be listed.</param> 53 public AboutDialog(IEnumerable<IPluginDescription> plugins) 54 : this() { 55 UpdatePluginList(plugins); 56 } 57 58 private void UpdatePluginList(IEnumerable<IPluginDescription> plugins) { 59 pluginListView.Items.Clear(); 60 foreach (var plugin in plugins) { 61 ListViewItem pluginItem = CreateListViewItem(plugin); 62 pluginListView.Items.Add(pluginItem); 63 } 64 Util.ResizeColumns(pluginListView.Columns.OfType<ColumnHeader>()); 55 public AboutDialog() 56 : this(ApplicationManager.Manager.Plugins) { 65 57 } 66 58 … … 91 83 92 84 private void pluginListView_ItemActivate(object sender, EventArgs e) { 93 if (pluginListView.SelectedItems.Count > 0) {94 PluginView view = new PluginView((IPluginDescription)pluginListView.SelectedItems[0].Tag);95 view.Show(this);96 }97 85 } 98 86 … … 108 96 System.Diagnostics.Process.Start("mailto:" + mailLinkLabel.Text); 109 97 } 98 99 private void showPluginsButton_Click(object sender, EventArgs e) { 100 var d = new PluginInformationDialog(plugins); 101 d.ShowDialog(this); 102 } 110 103 } 111 104 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/HeuristicLab.PluginInfrastructure.UI-4.0.csproj
r13360 r13363 60 60 <DependentUpon>FrameworkVersionErrorDialog.cs</DependentUpon> 61 61 </Compile> 62 <Compile Include="InstallationManagerControl.cs">63 <SubType>UserControl</SubType>64 </Compile>65 <Compile Include="InstallationManagerControl.Designer.cs">66 <DependentUpon>InstallationManagerControl.cs</DependentUpon>67 </Compile>68 <Compile Include="InstallationManagerForm.cs">69 <SubType>Form</SubType>70 </Compile>71 <Compile Include="InstallationManagerForm.Designer.cs">72 <DependentUpon>InstallationManagerForm.cs</DependentUpon>73 </Compile>74 <Compile Include="InstalledPluginsView.cs">75 <SubType>UserControl</SubType>76 </Compile>77 <Compile Include="InstalledPluginsView.Designer.cs">78 <DependentUpon>InstalledPluginsView.cs</DependentUpon>79 </Compile>80 <Compile Include="LicenseView.cs">81 <SubType>Form</SubType>82 </Compile>83 <Compile Include="LicenseView.Designer.cs">84 <DependentUpon>LicenseView.cs</DependentUpon>85 </Compile>86 <Compile Include="MultiSelectListView.cs">87 <SubType>Component</SubType>88 </Compile>89 <Compile Include="MultiSelectListView.Designer.cs">90 <DependentUpon>MultiSelectListView.cs</DependentUpon>91 </Compile>92 62 <Compile Include="PluginInformationDialog.cs"> 93 63 <SubType>Form</SubType> … … 95 65 <Compile Include="PluginInformationDialog.Designer.cs"> 96 66 <DependentUpon>PluginInformationDialog.cs</DependentUpon> 97 </Compile>98 <Compile Include="PluginView.cs">99 <SubType>Form</SubType>100 </Compile>101 <Compile Include="PluginView.Designer.cs">102 <DependentUpon>PluginView.cs</DependentUpon>103 67 </Compile> 104 68 <Compile Include="Properties\AssemblyInfo.cs" /> … … 116 80 <DependentUpon>StarterForm.cs</DependentUpon> 117 81 </Compile> 118 <Compile Include="Util.cs" />119 82 <Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" /> 120 83 </ItemGroup> 121 84 <ItemGroup> 122 <EmbeddedResource Include="PluginInformationDialog.resx">123 <DependentUpon>PluginInformationDialog.cs</DependentUpon>124 </EmbeddedResource>125 85 <EmbeddedResource Include="Resources\Error.ico" /> 126 86 <EmbeddedResource Include="Resources\HeuristicLab.ico" /> -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/PluginInformationDialog.Designer.cs
r13360 r13363 65 65 this.label = new System.Windows.Forms.Label(); 66 66 this.panel2 = new System.Windows.Forms.Panel(); 67 this.stateTextBox = new System.Windows.Forms.TextBox(); 68 this.label5 = new System.Windows.Forms.Label(); 67 69 this.panel1.SuspendLayout(); 68 70 this.panel2.SuspendLayout(); … … 158 160 this.textBox.BackColor = System.Drawing.SystemColors.HighlightText; 159 161 this.textBox.BorderStyle = System.Windows.Forms.BorderStyle.None; 160 this.textBox.Location = new System.Drawing.Point(6, 98);162 this.textBox.Location = new System.Drawing.Point(6, 117); 161 163 this.textBox.Name = "textBox"; 162 164 this.textBox.ReadOnly = true; 163 165 this.textBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; 164 this.textBox.Size = new System.Drawing.Size(526, 3 94);166 this.textBox.Size = new System.Drawing.Size(526, 375); 165 167 this.textBox.TabIndex = 11; 166 168 this.textBox.Text = "Files and License Text"; 167 169 this.textBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.licenseTextBox_LinkClicked); 168 170 this.textBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.textBox_MouseClick); 171 this.textBox.MouseLeave += new System.EventHandler(this.textBox_MouseLeave); 172 this.textBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.textBox_MouseMove); 169 173 // 170 174 // label2 … … 267 271 | System.Windows.Forms.AnchorStyles.Left) 268 272 | System.Windows.Forms.AnchorStyles.Right))); 273 this.panel2.Controls.Add(this.stateTextBox); 274 this.panel2.Controls.Add(this.label5); 269 275 this.panel2.Controls.Add(this.contactTextBox); 270 276 this.panel2.Controls.Add(this.mailLinkLabel); … … 282 288 this.panel2.Size = new System.Drawing.Size(554, 495); 283 289 this.panel2.TabIndex = 13; 290 // 291 // stateTextBox 292 // 293 this.stateTextBox.BackColor = System.Drawing.SystemColors.HighlightText; 294 this.stateTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; 295 this.stateTextBox.Location = new System.Drawing.Point(87, 98); 296 this.stateTextBox.Name = "stateTextBox"; 297 this.stateTextBox.ReadOnly = true; 298 this.stateTextBox.Size = new System.Drawing.Size(355, 13); 299 this.stateTextBox.TabIndex = 13; 300 this.stateTextBox.Text = "Enabled/Disabled"; 301 // 302 // label5 303 // 304 this.label5.AutoSize = true; 305 this.label5.Location = new System.Drawing.Point(3, 98); 306 this.label5.Margin = new System.Windows.Forms.Padding(3); 307 this.label5.Name = "label5"; 308 this.label5.Size = new System.Drawing.Size(35, 13); 309 this.label5.TabIndex = 12; 310 this.label5.Text = "State:"; 284 311 // 285 312 // PluginInformationDialog … … 327 354 private System.Windows.Forms.Label label; 328 355 private System.Windows.Forms.Panel panel2; 356 private System.Windows.Forms.TextBox stateTextBox; 357 private System.Windows.Forms.Label label5; 329 358 } 330 359 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/PluginInformationDialog.cs
r13360 r13363 52 52 pluginListView.Items.Add(pluginItem); 53 53 } 54 Util.ResizeColumns(pluginListView.Columns.OfType<ColumnHeader>());55 54 } 56 55 … … 101 100 productTextBox.Text = pluginDescription.Name; 102 101 versionTextBox.Text = pluginDescription.Version.ToString(); 103 contactTextBox.Text = 104 pluginDescription.ContactName + " " + pluginDescription.ContactEmail; 105 106 // build text and later replace plugindependency names with RTF links (too lazy to create RTF document) 107 textBox.Text = 108 pluginDescription.Description + 109 Environment.NewLine + Environment.NewLine + 110 "Files:" + Environment.NewLine + 111 string.Join(Environment.NewLine, pluginDescription.Files) + 112 Environment.NewLine + Environment.NewLine + 113 "Dependencies:" + Environment.NewLine; 102 contactTextBox.Text = pluginDescription.ContactName + " " + pluginDescription.ContactEmail; 103 stateTextBox.Text = pluginDescription.PluginState.ToString(); 104 105 textBox.Text = string.Empty; 106 textBox.AppendText(pluginDescription.Description + Environment.NewLine + Environment.NewLine); 107 108 if (!string.IsNullOrEmpty(pluginDescription.LoadingErrorInformation)) { 109 var startSel = textBox.TextLength; 110 textBox.AppendText("Error loading: " + pluginDescription.LoadingErrorInformation); 111 textBox.SelectionStart = startSel; 112 textBox.SelectionLength = textBox.TextLength; 113 textBox.SelectionColor = Color.Red; 114 textBox.AppendText(Environment.NewLine + Environment.NewLine); 115 } 116 117 textBox.AppendText("Files:" + Environment.NewLine); 118 foreach (var f in pluginDescription.Files) { 119 textBox.AppendText(f.Name); // might add icons for files here in the future 120 textBox.AppendText(Environment.NewLine); 121 } 122 123 textBox.AppendText(Environment.NewLine); 124 if (pluginDescription.Dependencies.Any()) 125 textBox.AppendText("Dependencies:" + Environment.NewLine); 114 126 115 127 // foreach dependency add a new line and set the formatting … … 146 158 147 159 private void textBox_MouseClick(object sender, MouseEventArgs e) { 148 int i = textBox.GetCharIndexFromPosition(e.Location); 149 var text = textBox.Text; 150 // extract clicked string (left and right are whitespace 151 int startPos = i; while (startPos >= 0 && !char.IsWhiteSpace(text[startPos])) startPos--; 152 int endPos = i; while (endPos < textBox.TextLength && !char.IsWhiteSpace(text[endPos])) endPos++; 153 string clickedWord = text.Substring(startPos + 1, endPos - startPos - 1); 160 var clickedWord = GetWordAtMousePos(e.Location); 154 161 155 162 pluginListView.SelectedItems.Clear(); … … 164 171 } 165 172 173 private void textBox_MouseMove(object sender, MouseEventArgs e) { 174 var wordUnderMouse = GetWordAtMousePos(e.Location); 175 176 // find first matching item 177 bool foundMatchingItem = false; 178 for (int pi = 0; pi < pluginListView.Items.Count; pi++) { 179 if (pluginListView.Items[pi].Text == wordUnderMouse) { 180 foundMatchingItem = true; 181 break; 182 } 183 } 184 // set to hand if a match is found 185 Cursor = foundMatchingItem ? Cursors.Hand : Cursors.Arrow; 186 } 187 private void textBox_MouseLeave(object sender, EventArgs e) { 188 // make sure the cursor is set to default when the control is left 189 Cursor = Cursors.Default; 190 } 191 192 private string GetWordAtMousePos(Point pos) { 193 int i = textBox.GetCharIndexFromPosition(pos); 194 if (i < 0 || i > textBox.TextLength) return string.Empty; 195 var text = textBox.Text; 196 // extract clicked string (left and right are whitespace 197 int startPos = i; while (startPos >= 0 && !char.IsWhiteSpace(text[startPos])) startPos--; 198 int endPos = i; while (endPos < textBox.TextLength && !char.IsWhiteSpace(text[endPos])) endPos++; 199 if (startPos == endPos) return string.Empty; 200 return text.Substring(startPos + 1, endPos - startPos - 1); 201 } 202 166 203 } 167 204 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Interfaces/IPluginDescription.cs
r12012 r13363 60 60 /// </summary> 61 61 string LicenseText { get; } 62 /// <summary> 63 /// Gets or sets the plugin state. 64 /// </summary> 65 PluginState PluginState { get; } 66 /// <summary> 67 /// Gets the error message why this plugin has been disabled. 68 /// </summary> 69 string LoadingErrorInformation { get; } 62 70 } 63 71 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/PluginValidator.cs
r13344 r13363 183 183 RegisterLoadedAssembly(asm); 184 184 assemblies.Add(asm); 185 } 186 catch (BadImageFormatException) { } // just ignore the case that the .dll file is not a CLR assembly (e.g. a native dll) 187 catch (FileLoadException) { } 188 catch (SecurityException) { } 189 catch (ReflectionTypeLoadException) { } // referenced assemblies are missing 185 } catch (BadImageFormatException) { } // just ignore the case that the .dll file is not a CLR assembly (e.g. a native dll) 186 catch (FileLoadException) { } catch (SecurityException) { } catch (ReflectionTypeLoadException) { } // referenced assemblies are missing 190 187 } 191 188 return assemblies; … … 216 213 desc.Disable(errorStrBuiler.ToString()); 217 214 } 218 } 219 catch (BadImageFormatException ex) { 215 } catch (BadImageFormatException ex) { 220 216 // disable the plugin 221 217 desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "BadImageFormatException: " + ex.Message); 222 } 223 catch (FileNotFoundException ex) { 218 } catch (FileNotFoundException ex) { 224 219 // disable the plugin 225 220 desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "FileNotFoundException: " + ex.Message); 226 } 227 catch (FileLoadException ex) { 221 } catch (FileLoadException ex) { 228 222 // disable the plugin 229 223 desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "FileLoadException: " + ex.Message); 230 } 231 catch (ArgumentException ex) { 224 } catch (ArgumentException ex) { 232 225 // disable the plugin 233 226 desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "ArgumentException: " + ex.Message); 234 } 235 catch (SecurityException ex) { 227 } catch (SecurityException ex) { 236 228 // disable the plugin 237 229 desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "SecurityException: " + ex.Message); … … 258 250 pluginDescriptions.AddRange(assemblyPluginDescriptions); 259 251 } 260 // ignore exceptions. Just don't yield a plugin description when an exception is thrown252 // ignore exceptions. Just don't yield a plugin description when an exception is thrown 261 253 catch (FileNotFoundException) { 262 } 263 catch (FileLoadException) { 264 } 265 catch (InvalidPluginException) { 266 } 267 catch (TypeLoadException) { 268 } 269 catch (MissingMemberException) { 254 } catch (FileLoadException) { 255 } catch (InvalidPluginException) { 256 } catch (TypeLoadException) { 257 } catch (MissingMemberException) { 270 258 } 271 259 } … … 339 327 try { 340 328 version = new Version((string)dependencyAttr.ConstructorArguments[1].Value); // might throw FormatException 341 } 342 catch (FormatException ex) { 329 } catch (FormatException ex) { 343 330 throw new InvalidPluginException("Invalid version format of dependency " + name + " in plugin " + pluginType.ToString(), ex); 344 331 } … … 519 506 Assembly.Load(assemblyName); 520 507 assemblyNames.Add(assemblyName); 521 } 522 catch (BadImageFormatException) { 508 } catch (BadImageFormatException) { 523 509 desc.Disable(Path.GetFileName(assemblyLocation) + " is not a valid assembly."); 524 } 525 catch (FileLoadException) { 510 } catch (FileLoadException) { 526 511 desc.Disable("Can't load file " + Path.GetFileName(assemblyLocation)); 527 } 528 catch (FileNotFoundException) { 512 } catch (FileNotFoundException) { 529 513 desc.Disable("File " + Path.GetFileName(assemblyLocation) + " is missing."); 530 } 531 catch (SecurityException) { 514 } catch (SecurityException) { 532 515 desc.Disable("File " + Path.GetFileName(assemblyLocation) + " can't be loaded because of security constraints."); 533 } 534 catch (NotSupportedException ex) { 516 } catch (NotSupportedException ex) { 535 517 // disable the plugin 536 518 desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "NotSupportedException: " + ex.Message);
Note: See TracChangeset
for help on using the changeset viewer.