📄 form1.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Xml;
namespace CreativeLearning
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frmCreative : System.Windows.Forms.Form
{
private System.Drawing.Icon m_Ready= new System.Drawing.Icon("Ready.ICO");
private System.Drawing.Icon m_Error= new System.Drawing.Icon("Error.ICO");
private System.Drawing.Icon m_Info= new System.Drawing.Icon("Info.ICO");
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.NotifyIcon icoNotify;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabSource;
private System.Windows.Forms.TabPage tabDest;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtSource;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtProcessedFile;
private System.Windows.Forms.CheckBox optGenerateLog;
private System.Windows.Forms.ContextMenu mnuNotify;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem mnuConfigure;
private System.Windows.Forms.MenuItem mnuExit;
private System.IO.FileSystemWatcher watchDir;
private System.Windows.Forms.ErrorProvider errMessage;
private System.Diagnostics.EventLog eventLog;
private System.Windows.Forms.GroupBox groupEventLog;
private System.Windows.Forms.ListBox lstEvents;
private System.Windows.Forms.Button btnRefresh;
private System.Windows.Forms.TextBox txtDest;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnSummary;
private System.Diagnostics.EventLog eventLog1;
private System.ComponentModel.IContainer components;
public frmCreative()
{
//
// 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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmCreative));
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.icoNotify = new System.Windows.Forms.NotifyIcon(this.components);
this.mnuNotify = new System.Windows.Forms.ContextMenu();
this.mnuConfigure = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.mnuExit = new System.Windows.Forms.MenuItem();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabSource = new System.Windows.Forms.TabPage();
this.optGenerateLog = new System.Windows.Forms.CheckBox();
this.txtProcessedFile = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtSource = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.tabDest = new System.Windows.Forms.TabPage();
this.btnSummary = new System.Windows.Forms.Button();
this.btnRefresh = new System.Windows.Forms.Button();
this.groupEventLog = new System.Windows.Forms.GroupBox();
this.lstEvents = new System.Windows.Forms.ListBox();
this.txtDest = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.watchDir = new System.IO.FileSystemWatcher();
this.errMessage = new System.Windows.Forms.ErrorProvider();
this.eventLog = new System.Diagnostics.EventLog();
this.eventLog1 = new System.Diagnostics.EventLog();
this.tabControl1.SuspendLayout();
this.tabSource.SuspendLayout();
this.tabDest.SuspendLayout();
this.groupEventLog.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.watchDir)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.eventLog)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.eventLog1)).BeginInit();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(56, 264);
this.btnOK.Name = "btnOK";
this.btnOK.TabIndex = 0;
this.btnOK.Text = "OK";
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(312, 264);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Exit";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// icoNotify
//
this.icoNotify.ContextMenu = this.mnuNotify;
this.icoNotify.Text = "Click here to configure options!";
this.icoNotify.MouseDown += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDown);
this.icoNotify.DoubleClick += new System.EventHandler(this.icoNotify_DoubleClick);
//
// mnuNotify
//
this.mnuNotify.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuConfigure,
this.menuItem2,
this.mnuExit});
this.mnuNotify.Popup += new System.EventHandler(this.mnuNotify_Popup);
//
// mnuConfigure
//
this.mnuConfigure.Index = 0;
this.mnuConfigure.Text = "Configure Application";
this.mnuConfigure.Click += new System.EventHandler(this.mnuConfigure_Click);
//
// menuItem2
//
this.menuItem2.Index = 1;
this.menuItem2.Text = "-";
//
// mnuExit
//
this.mnuExit.Index = 2;
this.mnuExit.Text = "Exit";
this.mnuExit.Click += new System.EventHandler(this.menuItem3_Click);
//
// tabControl1
//
this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabSource,
this.tabDest});
this.tabControl1.ImageList = this.imageList1;
this.tabControl1.Location = new System.Drawing.Point(32, 16);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(368, 224);
this.tabControl1.TabIndex = 2;
//
// tabSource
//
this.tabSource.Controls.AddRange(new System.Windows.Forms.Control[] {
this.optGenerateLog,
this.txtProcessedFile,
this.label3,
this.txtSource,
this.label1});
this.tabSource.ImageIndex = 0;
this.tabSource.Location = new System.Drawing.Point(4, 23);
this.tabSource.Name = "tabSource";
this.tabSource.Size = new System.Drawing.Size(360, 197);
this.tabSource.TabIndex = 0;
this.tabSource.Text = "Source Options";
//
// optGenerateLog
//
this.optGenerateLog.Location = new System.Drawing.Point(22, 128);
this.optGenerateLog.Name = "optGenerateLog";
this.optGenerateLog.Size = new System.Drawing.Size(296, 24);
this.optGenerateLog.TabIndex = 4;
this.optGenerateLog.Text = "Generate event log for bad file format";
this.optGenerateLog.CheckedChanged += new System.EventHandler(this.optGenerateLog_CheckedChanged);
//
// txtProcessedFile
//
this.txtProcessedFile.Location = new System.Drawing.Point(16, 80);
this.txtProcessedFile.Name = "txtProcessedFile";
this.txtProcessedFile.Size = new System.Drawing.Size(320, 20);
this.txtProcessedFile.TabIndex = 3;
this.txtProcessedFile.Text = "";
this.txtProcessedFile.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtProcessedFile_KeyUp);
//
// label3
//
this.label3.Location = new System.Drawing.Point(16, 56);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(192, 23);
this.label3.TabIndex = 2;
this.label3.Text = "After processing, move source file to:";
//
// txtSource
//
this.txtSource.Location = new System.Drawing.Point(128, 16);
this.txtSource.Name = "txtSource";
this.txtSource.Size = new System.Drawing.Size(208, 20);
this.txtSource.TabIndex = 1;
this.txtSource.Text = "";
this.txtSource.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSource_KeyUp);
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 18);
this.label1.Name = "label1";
this.label1.TabIndex = 0;
this.label1.Text = "Source Directory";
//
// tabDest
//
this.tabDest.Controls.AddRange(new System.Windows.Forms.Control[] {
this.btnSummary,
this.btnRefresh,
this.groupEventLog,
this.txtDest,
this.label2});
this.tabDest.ImageIndex = 0;
this.tabDest.Location = new System.Drawing.Point(4, 23);
this.tabDest.Name = "tabDest";
this.tabDest.Size = new System.Drawing.Size(360, 197);
this.tabDest.TabIndex = 1;
this.tabDest.Text = "Destination Options";
//
// btnSummary
//
this.btnSummary.Location = new System.Drawing.Point(16, 168);
this.btnSummary.Name = "btnSummary";
this.btnSummary.Size = new System.Drawing.Size(88, 23);
this.btnSummary.TabIndex = 4;
this.btnSummary.Text = "View Summary";
this.btnSummary.Click += new System.EventHandler(this.btnSummary_Click);
//
// btnRefresh
//
this.btnRefresh.Location = new System.Drawing.Point(264, 168);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.TabIndex = 3;
this.btnRefresh.Text = "Refresh Log";
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// groupEventLog
//
this.groupEventLog.Controls.AddRange(new System.Windows.Forms.Control[] {
this.lstEvents});
this.groupEventLog.Location = new System.Drawing.Point(16, 56);
this.groupEventLog.Name = "groupEventLog";
this.groupEventLog.Size = new System.Drawing.Size(320, 104);
this.groupEventLog.TabIndex = 2;
this.groupEventLog.TabStop = false;
this.groupEventLog.Text = "Event Log";
//
// lstEvents
//
this.lstEvents.HorizontalScrollbar = true;
this.lstEvents.Location = new System.Drawing.Point(16, 16);
this.lstEvents.Name = "lstEvents";
this.lstEvents.Size = new System.Drawing.Size(288, 69);
this.lstEvents.TabIndex = 0;
//
// txtDest
//
this.txtDest.Location = new System.Drawing.Point(128, 16);
this.txtDest.Name = "txtDest";
this.txtDest.Size = new System.Drawing.Size(208, 20);
this.txtDest.TabIndex = 1;
this.txtDest.Text = "";
this.txtDest.TextChanged += new System.EventHandler(this.txtDest_TextChanged);
this.txtDest.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtDest_KeyUp);
//
// label2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -