Continuato gestione selezione dinamica

This commit is contained in:
Samuele E. Locatelli
2020-08-25 08:46:25 +02:00
parent d60db7fd27
commit b8da54328e
4 changed files with 349 additions and 226 deletions
+5 -5
View File
@@ -53,16 +53,16 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
+217 -198
View File
@@ -31,22 +31,6 @@
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.ErrorsDGV = new System.Windows.Forms.DataGridView();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.lblApp = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
this.lblVers = new System.Windows.Forms.ToolStripStatusLabel();
this.gboxFiltri = new System.Windows.Forms.GroupBox();
this.listApp = new System.Windows.Forms.ListBox();
this.listHost = new System.Windows.Forms.ListBox();
this.listStatus = new System.Windows.Forms.ListBox();
this.listType = new System.Windows.Forms.ListBox();
this.listUsers = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.btnLoad = new System.Windows.Forms.Button();
this.errorIdDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.applicationDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.hostDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -58,11 +42,28 @@
this.timeUtcDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.sequenceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.bsErrors = new System.Windows.Forms.BindingSource(this.components);
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.lblApp = new System.Windows.Forms.ToolStripStatusLabel();
this.lblVers = new System.Windows.Forms.ToolStripStatusLabel();
this.progBar = new System.Windows.Forms.ToolStripProgressBar();
this.tsslNumRec = new System.Windows.Forms.ToolStripStatusLabel();
this.gboxFiltri = new System.Windows.Forms.GroupBox();
this.chkUsers = new System.Windows.Forms.CheckBox();
this.chkStatus = new System.Windows.Forms.CheckBox();
this.chkHost = new System.Windows.Forms.CheckBox();
this.chkType = new System.Windows.Forms.CheckBox();
this.chkApp = new System.Windows.Forms.CheckBox();
this.btnDelete = new System.Windows.Forms.Button();
this.listUsers = new System.Windows.Forms.ListBox();
this.listType = new System.Windows.Forms.ListBox();
this.listStatus = new System.Windows.Forms.ListBox();
this.listHost = new System.Windows.Forms.ListBox();
this.listApp = new System.Windows.Forms.ListBox();
this.timerUI = new System.Windows.Forms.Timer(this.components);
((System.ComponentModel.ISupportInitialize)(this.ErrorsDGV)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bsErrors)).BeginInit();
this.statusStrip1.SuspendLayout();
this.gboxFiltri.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.bsErrors)).BeginInit();
this.SuspendLayout();
//
// ErrorsDGV
@@ -87,178 +88,13 @@
this.timeUtcDataGridViewTextBoxColumn,
this.sequenceDataGridViewTextBoxColumn});
this.ErrorsDGV.DataSource = this.bsErrors;
this.ErrorsDGV.Location = new System.Drawing.Point(16, 134);
this.ErrorsDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ErrorsDGV.Location = new System.Drawing.Point(12, 119);
this.ErrorsDGV.Name = "ErrorsDGV";
this.ErrorsDGV.ReadOnly = true;
this.ErrorsDGV.RowHeadersWidth = 51;
this.ErrorsDGV.Size = new System.Drawing.Size(1223, 389);
this.ErrorsDGV.Size = new System.Drawing.Size(917, 486);
this.ErrorsDGV.TabIndex = 0;
//
// statusStrip1
//
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblApp,
this.toolStripProgressBar1,
this.lblVers});
this.statusStrip1.Location = new System.Drawing.Point(0, 528);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0);
this.statusStrip1.Size = new System.Drawing.Size(1255, 26);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// lblApp
//
this.lblApp.Name = "lblApp";
this.lblApp.Size = new System.Drawing.Size(55, 20);
this.lblApp.Text = "SELMA";
//
// toolStripProgressBar1
//
this.toolStripProgressBar1.Name = "toolStripProgressBar1";
this.toolStripProgressBar1.Size = new System.Drawing.Size(133, 18);
//
// lblVers
//
this.lblVers.Name = "lblVers";
this.lblVers.Size = new System.Drawing.Size(50, 20);
this.lblVers.Text = "0.0.0.0";
//
// gboxFiltri
//
this.gboxFiltri.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gboxFiltri.Controls.Add(this.btnDelete);
this.gboxFiltri.Controls.Add(this.btnLoad);
this.gboxFiltri.Controls.Add(this.label5);
this.gboxFiltri.Controls.Add(this.label4);
this.gboxFiltri.Controls.Add(this.label3);
this.gboxFiltri.Controls.Add(this.label2);
this.gboxFiltri.Controls.Add(this.label1);
this.gboxFiltri.Controls.Add(this.listUsers);
this.gboxFiltri.Controls.Add(this.listType);
this.gboxFiltri.Controls.Add(this.listStatus);
this.gboxFiltri.Controls.Add(this.listHost);
this.gboxFiltri.Controls.Add(this.listApp);
this.gboxFiltri.Location = new System.Drawing.Point(16, 12);
this.gboxFiltri.Name = "gboxFiltri";
this.gboxFiltri.Size = new System.Drawing.Size(1223, 115);
this.gboxFiltri.TabIndex = 2;
this.gboxFiltri.TabStop = false;
this.gboxFiltri.Text = "Filtri";
//
// listApp
//
this.listApp.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listApp.FormattingEnabled = true;
this.listApp.ItemHeight = 16;
this.listApp.Location = new System.Drawing.Point(7, 38);
this.listApp.Name = "listApp";
this.listApp.Size = new System.Drawing.Size(176, 68);
this.listApp.TabIndex = 0;
this.listApp.SelectedIndexChanged += new System.EventHandler(this.listApp_SelectedIndexChanged);
//
// listHost
//
this.listHost.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listHost.FormattingEnabled = true;
this.listHost.ItemHeight = 16;
this.listHost.Location = new System.Drawing.Point(189, 38);
this.listHost.Name = "listHost";
this.listHost.Size = new System.Drawing.Size(92, 68);
this.listHost.TabIndex = 1;
this.listHost.SelectedIndexChanged += new System.EventHandler(this.listHost_SelectedIndexChanged);
//
// listStatus
//
this.listStatus.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listStatus.FormattingEnabled = true;
this.listStatus.ItemHeight = 16;
this.listStatus.Location = new System.Drawing.Point(287, 38);
this.listStatus.Name = "listStatus";
this.listStatus.Size = new System.Drawing.Size(87, 68);
this.listStatus.TabIndex = 2;
this.listStatus.SelectedIndexChanged += new System.EventHandler(this.listStatus_SelectedIndexChanged);
//
// listType
//
this.listType.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listType.FormattingEnabled = true;
this.listType.ItemHeight = 16;
this.listType.Location = new System.Drawing.Point(380, 38);
this.listType.Name = "listType";
this.listType.Size = new System.Drawing.Size(393, 68);
this.listType.TabIndex = 3;
this.listType.SelectedIndexChanged += new System.EventHandler(this.listType_SelectedIndexChanged);
//
// listUsers
//
this.listUsers.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listUsers.FormattingEnabled = true;
this.listUsers.ItemHeight = 16;
this.listUsers.Location = new System.Drawing.Point(779, 38);
this.listUsers.Name = "listUsers";
this.listUsers.Size = new System.Drawing.Size(135, 68);
this.listUsers.TabIndex = 4;
this.listUsers.SelectedIndexChanged += new System.EventHandler(this.listUsers_SelectedIndexChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(33, 17);
this.label1.TabIndex = 5;
this.label1.Text = "App";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(186, 18);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(37, 17);
this.label2.TabIndex = 6;
this.label2.Text = "Host";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(287, 18);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(48, 17);
this.label3.TabIndex = 7;
this.label3.Text = "Status";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(377, 18);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(40, 17);
this.label4.TabIndex = 8;
this.label4.Text = "Type";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(776, 18);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(45, 17);
this.label5.TabIndex = 9;
this.label5.Text = "Users";
//
// btnLoad
//
this.btnLoad.Location = new System.Drawing.Point(935, 38);
this.btnLoad.Name = "btnLoad";
this.btnLoad.Size = new System.Drawing.Size(131, 68);
this.btnLoad.TabIndex = 10;
this.btnLoad.Text = "SEARCH";
this.btnLoad.UseVisualStyleBackColor = true;
this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
//
// errorIdDataGridViewTextBoxColumn
//
this.errorIdDataGridViewTextBoxColumn.DataPropertyName = "ErrorId";
@@ -353,34 +189,216 @@
//
this.bsErrors.DataSource = typeof(AppData.ELMAH_Error);
//
// statusStrip1
//
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblApp,
this.lblVers,
this.progBar,
this.tsslNumRec});
this.statusStrip1.Location = new System.Drawing.Point(0, 608);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(941, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// lblApp
//
this.lblApp.Name = "lblApp";
this.lblApp.Size = new System.Drawing.Size(44, 17);
this.lblApp.Text = "SELMA";
//
// lblVers
//
this.lblVers.Name = "lblVers";
this.lblVers.Size = new System.Drawing.Size(40, 17);
this.lblVers.Text = "0.0.0.0";
//
// progBar
//
this.progBar.Name = "progBar";
this.progBar.Size = new System.Drawing.Size(100, 16);
//
// tsslNumRec
//
this.tsslNumRec.Name = "tsslNumRec";
this.tsslNumRec.Size = new System.Drawing.Size(13, 17);
this.tsslNumRec.Text = "0";
//
// gboxFiltri
//
this.gboxFiltri.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gboxFiltri.Controls.Add(this.chkUsers);
this.gboxFiltri.Controls.Add(this.chkStatus);
this.gboxFiltri.Controls.Add(this.chkHost);
this.gboxFiltri.Controls.Add(this.chkType);
this.gboxFiltri.Controls.Add(this.chkApp);
this.gboxFiltri.Controls.Add(this.btnDelete);
this.gboxFiltri.Controls.Add(this.listUsers);
this.gboxFiltri.Controls.Add(this.listType);
this.gboxFiltri.Controls.Add(this.listStatus);
this.gboxFiltri.Controls.Add(this.listHost);
this.gboxFiltri.Controls.Add(this.listApp);
this.gboxFiltri.Location = new System.Drawing.Point(12, 10);
this.gboxFiltri.Margin = new System.Windows.Forms.Padding(2);
this.gboxFiltri.Name = "gboxFiltri";
this.gboxFiltri.Padding = new System.Windows.Forms.Padding(2);
this.gboxFiltri.Size = new System.Drawing.Size(917, 104);
this.gboxFiltri.TabIndex = 2;
this.gboxFiltri.TabStop = false;
this.gboxFiltri.Text = "Filtri";
//
// chkUsers
//
this.chkUsers.AutoSize = true;
this.chkUsers.Location = new System.Drawing.Point(584, 14);
this.chkUsers.Name = "chkUsers";
this.chkUsers.Size = new System.Drawing.Size(53, 17);
this.chkUsers.TabIndex = 16;
this.chkUsers.Text = "Users";
this.chkUsers.UseVisualStyleBackColor = true;
this.chkUsers.CheckedChanged += new System.EventHandler(this.chkUsers_CheckedChanged);
//
// chkStatus
//
this.chkStatus.AutoSize = true;
this.chkStatus.Location = new System.Drawing.Point(215, 14);
this.chkStatus.Name = "chkStatus";
this.chkStatus.Size = new System.Drawing.Size(56, 17);
this.chkStatus.TabIndex = 15;
this.chkStatus.Text = "Status";
this.chkStatus.UseVisualStyleBackColor = true;
this.chkStatus.CheckedChanged += new System.EventHandler(this.chkStatus_CheckedChanged);
//
// chkHost
//
this.chkHost.AutoSize = true;
this.chkHost.Location = new System.Drawing.Point(142, 14);
this.chkHost.Name = "chkHost";
this.chkHost.Size = new System.Drawing.Size(48, 17);
this.chkHost.TabIndex = 14;
this.chkHost.Text = "Host";
this.chkHost.UseVisualStyleBackColor = true;
this.chkHost.CheckedChanged += new System.EventHandler(this.chkHost_CheckedChanged);
//
// chkType
//
this.chkType.AutoSize = true;
this.chkType.Location = new System.Drawing.Point(285, 14);
this.chkType.Name = "chkType";
this.chkType.Size = new System.Drawing.Size(50, 17);
this.chkType.TabIndex = 13;
this.chkType.Text = "Type";
this.chkType.UseVisualStyleBackColor = true;
this.chkType.CheckedChanged += new System.EventHandler(this.chkType_CheckedChanged);
//
// chkApp
//
this.chkApp.AutoSize = true;
this.chkApp.Location = new System.Drawing.Point(5, 14);
this.chkApp.Name = "chkApp";
this.chkApp.Size = new System.Drawing.Size(45, 17);
this.chkApp.TabIndex = 12;
this.chkApp.Text = "App";
this.chkApp.UseVisualStyleBackColor = true;
this.chkApp.CheckedChanged += new System.EventHandler(this.chkApp_CheckedChanged);
//
// btnDelete
//
this.btnDelete.Location = new System.Drawing.Point(1086, 38);
this.btnDelete.Location = new System.Drawing.Point(814, 31);
this.btnDelete.Margin = new System.Windows.Forms.Padding(2);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(131, 68);
this.btnDelete.Size = new System.Drawing.Size(98, 55);
this.btnDelete.TabIndex = 11;
this.btnDelete.Text = "DELETE";
this.btnDelete.Text = "DELETE FILTERED";
this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// listUsers
//
this.listUsers.Font = new System.Drawing.Font("Arial Narrow", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listUsers.FormattingEnabled = true;
this.listUsers.ItemHeight = 15;
this.listUsers.Location = new System.Drawing.Point(584, 31);
this.listUsers.Margin = new System.Windows.Forms.Padding(2);
this.listUsers.Name = "listUsers";
this.listUsers.Size = new System.Drawing.Size(102, 64);
this.listUsers.TabIndex = 4;
this.listUsers.SelectedIndexChanged += new System.EventHandler(this.listUsers_SelectedIndexChanged);
//
// listType
//
this.listType.Font = new System.Drawing.Font("Arial Narrow", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listType.FormattingEnabled = true;
this.listType.ItemHeight = 15;
this.listType.Location = new System.Drawing.Point(285, 31);
this.listType.Margin = new System.Windows.Forms.Padding(2);
this.listType.Name = "listType";
this.listType.Size = new System.Drawing.Size(296, 64);
this.listType.TabIndex = 3;
this.listType.SelectedIndexChanged += new System.EventHandler(this.listType_SelectedIndexChanged);
//
// listStatus
//
this.listStatus.Font = new System.Drawing.Font("Arial Narrow", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listStatus.FormattingEnabled = true;
this.listStatus.ItemHeight = 15;
this.listStatus.Location = new System.Drawing.Point(215, 31);
this.listStatus.Margin = new System.Windows.Forms.Padding(2);
this.listStatus.Name = "listStatus";
this.listStatus.Size = new System.Drawing.Size(66, 64);
this.listStatus.TabIndex = 2;
this.listStatus.SelectedIndexChanged += new System.EventHandler(this.listStatus_SelectedIndexChanged);
//
// listHost
//
this.listHost.Font = new System.Drawing.Font("Arial Narrow", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listHost.FormattingEnabled = true;
this.listHost.ItemHeight = 15;
this.listHost.Location = new System.Drawing.Point(142, 31);
this.listHost.Margin = new System.Windows.Forms.Padding(2);
this.listHost.Name = "listHost";
this.listHost.Size = new System.Drawing.Size(70, 64);
this.listHost.TabIndex = 1;
this.listHost.SelectedIndexChanged += new System.EventHandler(this.listHost_SelectedIndexChanged);
//
// listApp
//
this.listApp.Font = new System.Drawing.Font("Arial Narrow", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listApp.FormattingEnabled = true;
this.listApp.ItemHeight = 15;
this.listApp.Location = new System.Drawing.Point(5, 31);
this.listApp.Margin = new System.Windows.Forms.Padding(2);
this.listApp.Name = "listApp";
this.listApp.Size = new System.Drawing.Size(133, 64);
this.listApp.TabIndex = 0;
this.listApp.SelectedIndexChanged += new System.EventHandler(this.listApp_SelectedIndexChanged);
//
// timerUI
//
this.timerUI.Interval = 50;
this.timerUI.Tick += new System.EventHandler(this.timerUI_Tick);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1255, 554);
this.ClientSize = new System.Drawing.Size(941, 630);
this.Controls.Add(this.gboxFiltri);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.ErrorsDGV);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.Name = "MainForm";
this.Text = "Steamware Elma Log Monitor and Analysis";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
((System.ComponentModel.ISupportInitialize)(this.ErrorsDGV)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bsErrors)).EndInit();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.gboxFiltri.ResumeLayout(false);
this.gboxFiltri.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.bsErrors)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -404,7 +422,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn tagsDataGridViewTextBoxColumn;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel lblApp;
private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
private System.Windows.Forms.ToolStripProgressBar progBar;
private System.Windows.Forms.ToolStripStatusLabel lblVers;
private System.Windows.Forms.GroupBox gboxFiltri;
private System.Windows.Forms.ListBox listApp;
@@ -412,13 +430,14 @@
private System.Windows.Forms.ListBox listHost;
private System.Windows.Forms.ListBox listUsers;
private System.Windows.Forms.ListBox listType;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnLoad;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.CheckBox chkType;
private System.Windows.Forms.CheckBox chkApp;
private System.Windows.Forms.CheckBox chkStatus;
private System.Windows.Forms.CheckBox chkHost;
private System.Windows.Forms.CheckBox chkUsers;
private System.Windows.Forms.ToolStripStatusLabel tsslNumRec;
private System.Windows.Forms.Timer timerUI;
}
}
+124 -23
View File
@@ -17,11 +17,31 @@ namespace ELMA
ElmahModel model = new ElmahModel();
#region area init & close
public MainForm()
{
InitializeComponent();
myInit();
startTimers();
}
private void startTimers()
{
timerUI.Start();
}
private void timerUI_Tick(object sender, EventArgs e)
{
progBar.Increment(1);
if (progBar.Value >= 100)
{
progBar.Value = 0;
}
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
timerUI.Stop();
}
private void myInit()
@@ -74,25 +94,50 @@ namespace ELMA
listUsers.Items.Add(item.User);
}
listUsers.SelectedIndex = 0;
checkFilterVisibility();
}
#endregion
#region Utils e metodi dati
private void checkFilterVisibility()
{
// Verifico TUTTI i filtri
listApp.Enabled = chkApp.Checked;
listHost.Enabled = chkHost.Checked;
listStatus.Enabled = chkStatus.Checked;
listType.Enabled = chkType.Checked;
listUsers.Enabled = chkUsers.Checked;
}
protected string selApp { get { return listApp.SelectedItem.ToString(); } }
protected string selStatus { get { return listStatus.SelectedItem.ToString(); } }
protected string selStatus
{
get
{
string answ = "";
if (chkStatus.Checked)
{
if (listStatus.SelectedItem != null)
{
answ = listStatus.SelectedItem.ToString();
}
}
return answ;
}
}
protected string selHost { get { return listHost.SelectedItem.ToString(); } }
protected string selType { get { return listType.SelectedItem.ToString(); } }
protected string selUser { get { return listUsers.SelectedItem.ToString(); } }
private void btnLoad_Click(object sender, EventArgs e)
{
updateSelection();
//this.bsErrors.DataSource = model.ELMAH_Error.Local.ToBindingList();
}
private void updateSelection()
{
List<ELMAH_Error> subset = getFiltData();
this.bsErrors.DataSource = subset;
tsslNumRec.Text = $"{subset.Count} rec";
}
private List<ELMAH_Error> getFiltData()
@@ -101,40 +146,67 @@ namespace ELMA
int statusCode = 0;
int.TryParse(selStatus, out statusCode);
string selApp = listApp.SelectedItem.ToString();
// fix DGV
var subset = dbSet.Where(x =>
x.StatusCode == statusCode
&& x.Application == selApp
&& x.Host == selHost
&& x.Type == selType
&& x.User == selUser
).ToList();
return subset;
// inizio azione filtraggio..
IQueryable<ELMAH_Error> subset = dbSet.Where(x => x.Sequence > 0);
if (chkApp.Checked)
{
subset = subset.Where(x => x.Application == selApp);
}
if (chkHost.Checked)
{
subset = subset.Where(x => x.Host == selHost);
}
if (chkStatus.Checked)
{
subset = subset.Where(x => x.StatusCode == statusCode);
}
if (chkType.Checked)
{
subset = subset.Where(x => x.Type == selType);
}
if (chkUsers.Checked)
{
subset = subset.Where(x => x.User == selUser);
}
return subset.ToList();
}
/// <summary>
/// Aggiornamento visualizzazioni
/// </summary>
private void doUpdate()
{
checkFilterVisibility();
updateSelection();
}
#endregion
#region area interazione
private void listApp_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
doUpdate();
}
private void listHost_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
doUpdate();
}
private void listStatus_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
doUpdate();
}
private void listType_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
doUpdate();
}
private void listUsers_SelectedIndexChanged(object sender, EventArgs e)
{
//updateSelection();
doUpdate();
}
private void btnDelete_Click(object sender, EventArgs e)
@@ -151,5 +223,34 @@ namespace ELMA
// aggiorno
updateSelection();
}
private void chkApp_CheckedChanged(object sender, EventArgs e)
{
doUpdate();
}
private void chkType_CheckedChanged(object sender, EventArgs e)
{
doUpdate();
}
private void chkStatus_CheckedChanged(object sender, EventArgs e)
{
doUpdate();
}
private void chkHost_CheckedChanged(object sender, EventArgs e)
{
doUpdate();
}
private void chkUsers_CheckedChanged(object sender, EventArgs e)
{
doUpdate();
}
#endregion
}
}
+3
View File
@@ -123,6 +123,9 @@
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>113, 17</value>
</metadata>
<metadata name="timerUI.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>229, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>