Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13363


Ignore:
Timestamp:
11/24/15 16:34:17 (9 years ago)
Author:
gkronber
Message:

#2522: improvements to new PluginInformationDialog and removed obsolete classes

Location:
branches/RefactorPluginInfrastructure-2522
Files:
13 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.Designer.cs

    r13338 r13363  
    4747      this.components = new System.ComponentModel.Container();
    4848      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();
    5349      this.imageList = new System.Windows.Forms.ImageList(this.components);
    5450      this.pictureBox = new System.Windows.Forms.PictureBox();
     
    5955      this.versionTextBox = new System.Windows.Forms.TextBox();
    6056      this.copyrightTextBox = new System.Windows.Forms.TextBox();
    61       this.pluginsGroupBox = new System.Windows.Forms.GroupBox();
    6257      this.licenseTextBox = new System.Windows.Forms.RichTextBox();
    6358      this.label2 = new System.Windows.Forms.Label();
     
    6661      this.webLinkLabel = new System.Windows.Forms.LinkLabel();
    6762      this.mailLinkLabel = new System.Windows.Forms.LinkLabel();
     63      this.showPluginsButton = new System.Windows.Forms.Button();
    6864      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
    69       this.pluginsGroupBox.SuspendLayout();
    7065      this.panel1.SuspendLayout();
    7166      this.SuspendLayout();
     
    8378      this.okButton.Click += new System.EventHandler(this.okButton_Click);
    8479      //
    85       // pluginListView
    86       //
    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       // pluginNameColumnHeader
    106       //
    107       this.pluginNameColumnHeader.Text = "Name";
    108       //
    109       // pluginVersionColumnHeader
    110       //
    111       this.pluginVersionColumnHeader.Text = "Version";
    112       //
    113       // pluginDescriptionColumnHeader
    114       //
    115       this.pluginDescriptionColumnHeader.Text = "Description";
    116       //
    11780      // imageList
    11881      //
     
    191154      this.copyrightTextBox.Text = "(C)";
    192155      //
    193       // pluginsGroupBox
    194       //
    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       //
    206156      // licenseTextBox
    207157      //
    208       this.licenseTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    209                   | System.Windows.Forms.AnchorStyles.Right)));
     158      this.licenseTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     159            | System.Windows.Forms.AnchorStyles.Right)));
    210160      this.licenseTextBox.BackColor = System.Drawing.SystemColors.HighlightText;
    211161      this.licenseTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
     
    230180      // panel1
    231181      //
    232       this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    233                   | System.Windows.Forms.AnchorStyles.Right)));
     182      this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
     183            | System.Windows.Forms.AnchorStyles.Right)));
    234184      this.panel1.BackColor = System.Drawing.SystemColors.Control;
    235185      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);
    237187      this.panel1.Name = "panel1";
    238188      this.panel1.Size = new System.Drawing.Size(626, 48);
     
    270220      this.mailLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.mailLinkLabel_LinkClicked);
    271221      //
     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      //
    272232      // AboutDialog
    273233      //
    274234      this.AcceptButton = this.okButton;
    275       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    276235      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    277236      this.BackColor = System.Drawing.SystemColors.Window;
    278237      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);
    280240      this.Controls.Add(this.mailLinkLabel);
    281241      this.Controls.Add(this.webLinkLabel);
     
    284244      this.Controls.Add(this.label2);
    285245      this.Controls.Add(this.licenseTextBox);
    286       this.Controls.Add(this.pluginsGroupBox);
    287246      this.Controls.Add(this.copyrightTextBox);
    288247      this.Controls.Add(this.versionTextBox);
     
    292251      this.Controls.Add(this.label);
    293252      this.Controls.Add(this.pictureBox);
    294       this.Icon = Resources.HeuristicLab;
     253      this.Icon = global::HeuristicLab.PluginInfrastructure.UI.Resources.HeuristicLab;
    295254      this.MaximizeBox = false;
    296255      this.MinimizeBox = false;
     
    299258      this.Text = "About HeuristicLab";
    300259      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
    301       this.pluginsGroupBox.ResumeLayout(false);
    302260      this.panel1.ResumeLayout(false);
    303261      this.ResumeLayout(false);
     
    309267
    310268    private System.Windows.Forms.Button okButton;
    311     private System.Windows.Forms.ListView pluginListView;
    312269    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;
    316270    private System.Windows.Forms.PictureBox pictureBox;
    317271    private System.Windows.Forms.Label label;
     
    321275    private System.Windows.Forms.TextBox versionTextBox;
    322276    private System.Windows.Forms.TextBox copyrightTextBox;
    323     private System.Windows.Forms.GroupBox pluginsGroupBox;
    324277    private System.Windows.Forms.RichTextBox licenseTextBox;
    325278    private System.Windows.Forms.Label label2;
     
    328281    private System.Windows.Forms.LinkLabel webLinkLabel;
    329282    private System.Windows.Forms.LinkLabel mailLinkLabel;
     283    private System.Windows.Forms.Button showPluginsButton;
    330284  }
    331285}
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/AboutDialog.cs

    r13353 r13363  
    3131  /// </summary>
    3232  public partial class AboutDialog : Form {
     33    private List<IPluginDescription> plugins;
     34
    3335    /// <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.
    3537    /// </summary>
    36     public AboutDialog() {
     38    /// <param name="plugins">Enumerable of plugins that should be listed.</param>
     39    public AboutDialog(IEnumerable<IPluginDescription> plugins) {
    3740      InitializeComponent();
    3841      var entryAssembly = Assembly.GetEntryAssembly();
     
    4346      pictureBox.Image = Resources.HeuristicLabLogo;
    4447      licenseTextBox.Text = Resources.LicenseText;
    45       UpdatePluginList(ApplicationManager.Manager.Plugins);
     48      this.plugins = plugins.ToList();
    4649      ActiveControl = okButton;
    4750    }
    4851
    4952    /// <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.
    5154    /// </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) {
    6557    }
    6658
     
    9183
    9284    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       }
    9785    }
    9886
     
    10896      System.Diagnostics.Process.Start("mailto:" + mailLinkLabel.Text);
    10997    }
     98
     99    private void showPluginsButton_Click(object sender, EventArgs e) {
     100      var d = new PluginInformationDialog(plugins);
     101      d.ShowDialog(this);
     102    }
    110103  }
    111104}
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/HeuristicLab.PluginInfrastructure.UI-4.0.csproj

    r13360 r13363  
    6060      <DependentUpon>FrameworkVersionErrorDialog.cs</DependentUpon>
    6161    </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>
    9262    <Compile Include="PluginInformationDialog.cs">
    9363      <SubType>Form</SubType>
     
    9565    <Compile Include="PluginInformationDialog.Designer.cs">
    9666      <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>
    10367    </Compile>
    10468    <Compile Include="Properties\AssemblyInfo.cs" />
     
    11680      <DependentUpon>StarterForm.cs</DependentUpon>
    11781    </Compile>
    118     <Compile Include="Util.cs" />
    11982    <Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
    12083  </ItemGroup>
    12184  <ItemGroup>
    122     <EmbeddedResource Include="PluginInformationDialog.resx">
    123       <DependentUpon>PluginInformationDialog.cs</DependentUpon>
    124     </EmbeddedResource>
    12585    <EmbeddedResource Include="Resources\Error.ico" />
    12686    <EmbeddedResource Include="Resources\HeuristicLab.ico" />
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/PluginInformationDialog.Designer.cs

    r13360 r13363  
    6565      this.label = new System.Windows.Forms.Label();
    6666      this.panel2 = new System.Windows.Forms.Panel();
     67      this.stateTextBox = new System.Windows.Forms.TextBox();
     68      this.label5 = new System.Windows.Forms.Label();
    6769      this.panel1.SuspendLayout();
    6870      this.panel2.SuspendLayout();
     
    158160      this.textBox.BackColor = System.Drawing.SystemColors.HighlightText;
    159161      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);
    161163      this.textBox.Name = "textBox";
    162164      this.textBox.ReadOnly = true;
    163165      this.textBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
    164       this.textBox.Size = new System.Drawing.Size(526, 394);
     166      this.textBox.Size = new System.Drawing.Size(526, 375);
    165167      this.textBox.TabIndex = 11;
    166168      this.textBox.Text = "Files and License Text";
    167169      this.textBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.licenseTextBox_LinkClicked);
    168170      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);
    169173      //
    170174      // label2
     
    267271            | System.Windows.Forms.AnchorStyles.Left)
    268272            | System.Windows.Forms.AnchorStyles.Right)));
     273      this.panel2.Controls.Add(this.stateTextBox);
     274      this.panel2.Controls.Add(this.label5);
    269275      this.panel2.Controls.Add(this.contactTextBox);
    270276      this.panel2.Controls.Add(this.mailLinkLabel);
     
    282288      this.panel2.Size = new System.Drawing.Size(554, 495);
    283289      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:";
    284311      //
    285312      // PluginInformationDialog
     
    327354    private System.Windows.Forms.Label label;
    328355    private System.Windows.Forms.Panel panel2;
     356    private System.Windows.Forms.TextBox stateTextBox;
     357    private System.Windows.Forms.Label label5;
    329358  }
    330359}
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure.UI/PluginInformationDialog.cs

    r13360 r13363  
    5252        pluginListView.Items.Add(pluginItem);
    5353      }
    54       Util.ResizeColumns(pluginListView.Columns.OfType<ColumnHeader>());
    5554    }
    5655
     
    101100      productTextBox.Text = pluginDescription.Name;
    102101      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);
    114126
    115127      // foreach dependency add a new line and set the formatting
     
    146158
    147159    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);
    154161
    155162      pluginListView.SelectedItems.Clear();
     
    164171    }
    165172
     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
    166203  }
    167204}
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/Interfaces/IPluginDescription.cs

    r12012 r13363  
    6060    /// </summary>
    6161    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; }
    6270  }
    6371}
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.PluginInfrastructure/3.3/PluginValidator.cs

    r13344 r13363  
    183183          RegisterLoadedAssembly(asm);
    184184          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
    190187      }
    191188      return assemblies;
     
    216213            desc.Disable(errorStrBuiler.ToString());
    217214          }
    218         }
    219         catch (BadImageFormatException ex) {
     215        } catch (BadImageFormatException ex) {
    220216          // disable the plugin
    221217          desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "BadImageFormatException: " + ex.Message);
    222         }
    223         catch (FileNotFoundException ex) {
     218        } catch (FileNotFoundException ex) {
    224219          // disable the plugin
    225220          desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "FileNotFoundException: " + ex.Message);
    226         }
    227         catch (FileLoadException ex) {
     221        } catch (FileLoadException ex) {
    228222          // disable the plugin
    229223          desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "FileLoadException: " + ex.Message);
    230         }
    231         catch (ArgumentException ex) {
     224        } catch (ArgumentException ex) {
    232225          // disable the plugin
    233226          desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "ArgumentException: " + ex.Message);
    234         }
    235         catch (SecurityException ex) {
     227        } catch (SecurityException ex) {
    236228          // disable the plugin
    237229          desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "SecurityException: " + ex.Message);
     
    258250          pluginDescriptions.AddRange(assemblyPluginDescriptions);
    259251        }
    260         // ignore exceptions. Just don't yield a plugin description when an exception is thrown
     252          // ignore exceptions. Just don't yield a plugin description when an exception is thrown
    261253        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) {
    270258        }
    271259      }
     
    339327          try {
    340328            version = new Version((string)dependencyAttr.ConstructorArguments[1].Value); // might throw FormatException
    341           }
    342           catch (FormatException ex) {
     329          } catch (FormatException ex) {
    343330            throw new InvalidPluginException("Invalid version format of dependency " + name + " in plugin " + pluginType.ToString(), ex);
    344331          }
     
    519506              Assembly.Load(assemblyName);
    520507              assemblyNames.Add(assemblyName);
    521             }
    522             catch (BadImageFormatException) {
     508            } catch (BadImageFormatException) {
    523509              desc.Disable(Path.GetFileName(assemblyLocation) + " is not a valid assembly.");
    524             }
    525             catch (FileLoadException) {
     510            } catch (FileLoadException) {
    526511              desc.Disable("Can't load file " + Path.GetFileName(assemblyLocation));
    527             }
    528             catch (FileNotFoundException) {
     512            } catch (FileNotFoundException) {
    529513              desc.Disable("File " + Path.GetFileName(assemblyLocation) + " is missing.");
    530             }
    531             catch (SecurityException) {
     514            } catch (SecurityException) {
    532515              desc.Disable("File " + Path.GetFileName(assemblyLocation) + " can't be loaded because of security constraints.");
    533             }
    534             catch (NotSupportedException ex) {
     516            } catch (NotSupportedException ex) {
    535517              // disable the plugin
    536518              desc.Disable("Problem while loading plugin assemblies:" + Environment.NewLine + "NotSupportedException: " + ex.Message);
Note: See TracChangeset for help on using the changeset viewer.