marketbasedanalysis.cs
来自「一个经典的apriori算法(c#实现)」· CS 代码 · 共 465 行 · 第 1/2 页
CS
465 行
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using VISUAL_BASIC_DATA_MINING_NET;
using VISUAL_BASIC_DATA_MINING_NET.CustomEvents;
using VISUAL_BASIC_DATA_MINING_NET.DataTransformationServices;
namespace APrioriWindows
{
/// <summary>
/// Summary description for MarketBasedAnalysis.
/// </summary>
public class MarketBasedAnalysis : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.DataGrid dataGridViewAnalysisResult;
private System.Windows.Forms.GroupBox groupBoxCommands;
private System.Windows.Forms.Button buttonDataConnection;
//
//
private ConnectionDialogBox connectionDialogBox;
private System.Windows.Forms.Button buttonOK;
//
//
private System.Windows.Forms.GroupBox groupBoxSettings;
private System.Windows.Forms.Label lblSupportCount;
private System.Windows.Forms.Label lblMinimumConfidence;
private System.Windows.Forms.TextBox txtMinimumSupport;
private System.Windows.Forms.TextBox txtMinimumConfidence;
//
//
private DataMining DMS;
private ViewData dataView;
private Data dataAnalysis;
private NorthwindDTS dts;
private Data orders;
private string minimumConfidence;
private string minimumSupport;
private int minimumConfidenceLength;
private int minimumSupportLength;
private System.Windows.Forms.GroupBox groupBoxProgressMonitor;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label lblProgressBar;
private System.Windows.Forms.GroupBox groupBoxViewTables;
private System.Windows.Forms.ProgressBar progressBarMonitor;
//
//
//
/// <summary>
/// The public OnProgressMonitorEvent raises the ProgressMonitorEvent event by invoking
/// the delegates. The sender is always this, the current instance of the class.
/// </summary>
/// <param name="e">
/// A CustomEvents.ProgressMonitorEventArgs object.
/// </param>
/// <remarks>
/// This method is used to invoke a dalegate that notifies clients about the progress of an executing code.
/// </remarks>
public void OnProgressMonitorEvent(object sender, ProgressMonitorEventArgs e)
{
//Sets the information to be displayed on the progress bar
this.progressBarMonitor.Minimum = e.MinimumValue;
this.progressBarMonitor.Maximum = e.MaximumValue;
this.progressBarMonitor.Value = e.CurrentValue;
this.progressBarMonitor.Refresh();
this.lblProgressBar.Text = e.EventMessage;
this.lblProgressBar.Refresh();
}
/// <summary>
/// A custom event that notifies clients about the progress of the executing code.
/// </summary>
public event ProgressMonitorEventHandler ProgressMonitorEvent;
//
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public MarketBasedAnalysis()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBoxCommands = new System.Windows.Forms.GroupBox();
this.groupBoxSettings = new System.Windows.Forms.GroupBox();
this.lblMinimumConfidence = new System.Windows.Forms.Label();
this.txtMinimumConfidence = new System.Windows.Forms.TextBox();
this.lblSupportCount = new System.Windows.Forms.Label();
this.txtMinimumSupport = new System.Windows.Forms.TextBox();
this.buttonDataConnection = new System.Windows.Forms.Button();
this.dataGridViewAnalysisResult = new System.Windows.Forms.DataGrid();
this.groupBoxProgressMonitor = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblProgressBar = new System.Windows.Forms.Label();
this.progressBarMonitor = new System.Windows.Forms.ProgressBar();
this.buttonOK = new System.Windows.Forms.Button();
this.groupBoxViewTables = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.groupBoxCommands.SuspendLayout();
this.groupBoxSettings.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridViewAnalysisResult)).BeginInit();
this.groupBoxProgressMonitor.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.groupBoxCommands,
this.dataGridViewAnalysisResult});
this.groupBox1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.groupBox1.Location = new System.Drawing.Point(16, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(976, 528);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "C#.NET Market Based Data Mining Analysis";
//
// groupBoxCommands
//
this.groupBoxCommands.Controls.AddRange(new System.Windows.Forms.Control[] {
this.groupBoxViewTables,
this.groupBoxSettings,
this.buttonDataConnection});
this.groupBoxCommands.Location = new System.Drawing.Point(792, 16);
this.groupBoxCommands.Name = "groupBoxCommands";
this.groupBoxCommands.Size = new System.Drawing.Size(176, 504);
this.groupBoxCommands.TabIndex = 2;
this.groupBoxCommands.TabStop = false;
//
// groupBoxSettings
//
this.groupBoxSettings.Controls.AddRange(new System.Windows.Forms.Control[] {
this.lblMinimumConfidence,
this.txtMinimumConfidence,
this.lblSupportCount,
this.txtMinimumSupport});
this.groupBoxSettings.Location = new System.Drawing.Point(8, 360);
this.groupBoxSettings.Name = "groupBoxSettings";
this.groupBoxSettings.Size = new System.Drawing.Size(160, 136);
this.groupBoxSettings.TabIndex = 1;
this.groupBoxSettings.TabStop = false;
//
// lblMinimumConfidence
//
this.lblMinimumConfidence.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblMinimumConfidence.ForeColor = System.Drawing.Color.DarkBlue;
this.lblMinimumConfidence.Location = new System.Drawing.Point(8, 80);
this.lblMinimumConfidence.Name = "lblMinimumConfidence";
this.lblMinimumConfidence.Size = new System.Drawing.Size(144, 16);
this.lblMinimumConfidence.TabIndex = 3;
this.lblMinimumConfidence.Text = "Minimum Confidence %";
//
// txtMinimumConfidence
//
this.txtMinimumConfidence.Location = new System.Drawing.Point(8, 104);
this.txtMinimumConfidence.Name = "txtMinimumConfidence";
this.txtMinimumConfidence.Size = new System.Drawing.Size(144, 21);
this.txtMinimumConfidence.TabIndex = 2;
this.txtMinimumConfidence.Text = "";
this.txtMinimumConfidence.Validating += new System.ComponentModel.CancelEventHandler(this.txtMinimumConfidence_Validating);
//
// lblSupportCount
//
this.lblSupportCount.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblSupportCount.ForeColor = System.Drawing.Color.DarkBlue;
this.lblSupportCount.Location = new System.Drawing.Point(8, 16);
this.lblSupportCount.Name = "lblSupportCount";
this.lblSupportCount.Size = new System.Drawing.Size(136, 16);
this.lblSupportCount.TabIndex = 1;
this.lblSupportCount.Text = "Minimum Support %";
//
// txtMinimumSupport
//
this.txtMinimumSupport.Location = new System.Drawing.Point(8, 40);
this.txtMinimumSupport.Name = "txtMinimumSupport";
this.txtMinimumSupport.Size = new System.Drawing.Size(144, 21);
this.txtMinimumSupport.TabIndex = 0;
this.txtMinimumSupport.Text = "";
this.txtMinimumSupport.Validating += new System.ComponentModel.CancelEventHandler(this.txtMinimumSupport_Validating);
this.txtMinimumSupport.TextChanged += new System.EventHandler(this.txtMinimumSupport_TextChanged);
//
// buttonDataConnection
//
this.buttonDataConnection.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.buttonDataConnection.ForeColor = System.Drawing.Color.DarkBlue;
this.buttonDataConnection.Location = new System.Drawing.Point(24, 40);
this.buttonDataConnection.Name = "buttonDataConnection";
this.buttonDataConnection.Size = new System.Drawing.Size(128, 24);
this.buttonDataConnection.TabIndex = 0;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?