?? frmjscompressor.cs
字號:
namespace com.sarmal.scriptutil.text.compress.js.gui
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Resources;
using System.Threading;
using System.Text.RegularExpressions;
using com.sarmal.scriptutil.text.compress.js;
using com.sarmal.scriptutil.text.compress;
using com.sarmal.io;
/// <summary>
/// <disclaimer>2003-2005 (C) - sarmal.com - http://www.sarmal.com </disclaimer>
/// <meta-data>
/// <version>1.0.0</version>
/// <author>
/// <name>Volkan 謟鏴lik</name>
/// <e-mail>volkan@sarmal.com</e-mail>
/// </author>
/// </meta-data>
/// <description>
/// <p>The GUI for com.sarmal.text.compress.js.CodeCompressor.</p>
/// </description>
/// </summary>
public class FrmJSCompressor:Form
{
/// <summary>
/// Choose button.
/// </summary>
private Button BtnChoose;
/// <summary>
/// Copyright label.
/// </summary>
private Label LblCopyRight;
/// <summary>
/// Open File Dialog.
/// </summary>
private OpenFileDialog DlgOpenFile;
/// <summary>
/// File URL.
/// </summary>
private TextBox TxtFileURL;
/// <summary>
/// A background thread for compress operation.
/// This way, GUI is not suspended for long
/// compression operations.
/// </summary>
private Thread ThreadCompressor;
private System.Windows.Forms.Button BtnCompress;
private System.Windows.Forms.Label LblProgress;
private System.Windows.Forms.CheckBox ChkRemoveComment;
private System.Windows.Forms.CheckBox ChkRemoveCRLF;
private System.Windows.Forms.GroupBox GrpOptions;
private System.Windows.Forms.GroupBox GrpMainAction;
private System.Windows.Forms.GroupBox GrpProgress;
private System.Windows.Forms.GroupBox GrpFileChooser;
private System.Windows.Forms.CheckBox ChkTrimBlankLine;
private System.Windows.Forms.CheckBox ChkRemoveOther;
/// <summary>
/// Required designer variable.
/// </summary>
private Container components = null;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main() {
Application.Run(new FrmJSCompressor());
}
/// <summary>
/// Constructor.
/// </summary>
public FrmJSCompressor() {
InitializeComponent();
RegisterEventHandlers();
}
/// <summary>
/// All the event handlers are attached here.
/// </summary>
private void RegisterEventHandlers() {
DlgOpenFile.FileOk += new CancelEventHandler(DlgOpenFile_FileOk);
BtnChoose.Click += new EventHandler(BtnChoose_Click);
BtnCompress.Click += new EventHandler(BtnCompress_Click);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing){
if(disposing){
if (components != null) {components.Dispose();}
}
base.Dispose( disposing );
}
/// <summary>
/// Form designer generated initialization code.
/// Handle with care.
/// </summary>
private void InitializeComponent() {
ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmJSCompressor));
TxtFileURL = new TextBox();
BtnChoose = new Button();
DlgOpenFile = new OpenFileDialog();
LblCopyRight = new Label();
ChkRemoveComment = new CheckBox();
ChkRemoveCRLF = new CheckBox();
GrpOptions = new GroupBox();
BtnCompress = new Button();
GrpMainAction = new GroupBox();
LblProgress = new Label();
GrpProgress = new GroupBox();
GrpFileChooser = new GroupBox();
ChkTrimBlankLine = new CheckBox();
ChkRemoveOther = new CheckBox();
GrpOptions.SuspendLayout();
GrpMainAction.SuspendLayout();
GrpProgress.SuspendLayout();
GrpFileChooser.SuspendLayout();
SuspendLayout();
//
// TxtFileURL
//
TxtFileURL.BackColor = Color.FromArgb(((Byte)(255)), ((Byte)(236)), ((Byte)(184)));
TxtFileURL.BorderStyle = BorderStyle.FixedSingle;
TxtFileURL.Enabled = false;
TxtFileURL.Location = new Point(8, 16);
TxtFileURL.Name = "TxtFileURL";
TxtFileURL.Size = new Size(192, 21);
TxtFileURL.TabIndex = 0;
TxtFileURL.Text = "";
//
// BtnChoose
//
BtnChoose.BackColor =Color.FromArgb(((Byte)(79)), ((Byte)(13)), ((Byte)(204)));
BtnChoose.FlatStyle = FlatStyle.Popup;
BtnChoose.ForeColor = Color.White;
BtnChoose.Location = new Point(192, 16);
BtnChoose.Name = "BtnChoose";
BtnChoose.Size = new Size(56, 21);
BtnChoose.TabIndex = 1;
BtnChoose.Text = "choose";
//
// LblCopyRight
//
LblCopyRight.BackColor = Color.FromArgb(((Byte)(255)), ((Byte)(128)), ((Byte)(0)));
LblCopyRight.Dock = System.Windows.Forms.DockStyle.Bottom;
LblCopyRight.Font = new Font("Verdana", 6.75F, FontStyle.Bold, GraphicsUnit.Point, ((Byte)(162)));
LblCopyRight.ForeColor = System.Drawing.Color.White;
LblCopyRight.Location = new Point(0, 321);
LblCopyRight.Name = "LblCopyRight";
LblCopyRight.Size = new Size(280, 12);
LblCopyRight.TabIndex = 4;
LblCopyRight.Text = "2005
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -