From 6144c9b7ce57eb2bbeb4116c8794754aad08e6f4 Mon Sep 17 00:00:00 2001 From: "Christopher J. McClellan" Date: Sun, 21 Dec 2014 17:15:06 -0500 Subject: [PATCH] Displays Inspection Config info; not very user friendly yet --- .../CodeInspectionControl.Designer.cs | 29 ------------------- .../UI/Settings/CodeInspectionControl.cs | 18 ++++++++++++ .../UI/Settings/CodeInspectionControl.resx | 9 ------ RetailCoder.VBE/UI/Settings/SettingsDialog.cs | 3 +- 4 files changed, 20 insertions(+), 39 deletions(-) diff --git a/RetailCoder.VBE/UI/Settings/CodeInspectionControl.Designer.cs b/RetailCoder.VBE/UI/Settings/CodeInspectionControl.Designer.cs index d06421ac3a..888c070bcf 100644 --- a/RetailCoder.VBE/UI/Settings/CodeInspectionControl.Designer.cs +++ b/RetailCoder.VBE/UI/Settings/CodeInspectionControl.Designer.cs @@ -29,9 +29,6 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.InspectionName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.InspectionType = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.InspectionSeverity = new System.Windows.Forms.DataGridViewComboBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // @@ -40,35 +37,12 @@ private void InitializeComponent() this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.InspectionName, - this.InspectionType, - this.InspectionSeverity}); this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridView1.Location = new System.Drawing.Point(0, 0); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.Size = new System.Drawing.Size(476, 333); this.dataGridView1.TabIndex = 0; // - // InspectionName - // - this.InspectionName.Frozen = true; - this.InspectionName.HeaderText = "Inspection"; - this.InspectionName.Name = "InspectionName"; - this.InspectionName.ReadOnly = true; - // - // InspectionType - // - this.InspectionType.Frozen = true; - this.InspectionType.HeaderText = "Type"; - this.InspectionType.Name = "InspectionType"; - this.InspectionType.ReadOnly = true; - // - // InspectionSeverity - // - this.InspectionSeverity.HeaderText = "Severity"; - this.InspectionSeverity.Name = "InspectionSeverity"; - // // CodeInspectionControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -84,9 +58,6 @@ private void InitializeComponent() #endregion private System.Windows.Forms.DataGridView dataGridView1; - private System.Windows.Forms.DataGridViewTextBoxColumn InspectionName; - private System.Windows.Forms.DataGridViewTextBoxColumn InspectionType; - private System.Windows.Forms.DataGridViewComboBoxColumn InspectionSeverity; } } diff --git a/RetailCoder.VBE/UI/Settings/CodeInspectionControl.cs b/RetailCoder.VBE/UI/Settings/CodeInspectionControl.cs index bf8aa47af3..c8b2543c3c 100644 --- a/RetailCoder.VBE/UI/Settings/CodeInspectionControl.cs +++ b/RetailCoder.VBE/UI/Settings/CodeInspectionControl.cs @@ -7,14 +7,32 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Rubberduck.Config; namespace Rubberduck.UI.Settings { public partial class CodeInspectionControl : UserControl { + private Configuration _config; + private BindingList _inspections; + + /// Parameterless Constructor is to enable design view only. DO NOT USE. public CodeInspectionControl() { InitializeComponent(); } + + public CodeInspectionControl(Configuration config) + : this() + { + _config = config; + _inspections = new BindingList(_config.UserSettings.CodeInspectinSettings.CodeInspections.ToList()); + //this.dataGridView1.AutoGenerateColumns = true; + this.dataGridView1.DataSource = _inspections; + + //todo: change severity to combo box + + + } } } diff --git a/RetailCoder.VBE/UI/Settings/CodeInspectionControl.resx b/RetailCoder.VBE/UI/Settings/CodeInspectionControl.resx index 0746b9a316..1af7de150c 100644 --- a/RetailCoder.VBE/UI/Settings/CodeInspectionControl.resx +++ b/RetailCoder.VBE/UI/Settings/CodeInspectionControl.resx @@ -117,13 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - True - - - True - \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Settings/SettingsDialog.cs b/RetailCoder.VBE/UI/Settings/SettingsDialog.cs index 2fe3fe3119..a538c0c421 100644 --- a/RetailCoder.VBE/UI/Settings/SettingsDialog.cs +++ b/RetailCoder.VBE/UI/Settings/SettingsDialog.cs @@ -69,7 +69,8 @@ private void _treeview_NodeSelected(object sender, TreeViewEventArgs e) if (_inspections == null) { //todo: get inspection config from file - _inspections = new CodeInspectionControl(); + //note: might want to just pass an enumerable instead + _inspections = new CodeInspectionControl(_config); } this.splitContainer1.Panel2.Controls.Clear();