-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmJetExeList.cs
147 lines (132 loc) · 4.82 KB
/
frmJetExeList.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using 離線列印Client程式;
public class frmJetExeList : Form
{
private IContainer components;
private Panel panelPrint;
private ListBox ltExes;
private Button btnRemove;
private Button btnInsert;
private OpenFileDialog fdJetExe;
private Button btnConfirm;
public frmJetExeList()
{
InitializeComponent();
}
private void UpdateLt()
{
ltExes.Items.Clear();
foreach (string jetExecPath in Program.UserSettings.JetPrintSettings.JetExecPaths)
{
ltExes.Items.Add(jetExecPath);
}
}
private void btnInsert_Click(object sender, EventArgs e)
{
if (fdJetExe.ShowDialog() == DialogResult.OK)
{
if (Program.UserSettings.JetPrintSettings.JetExecPaths.IndexOf(fdJetExe.FileName) >= 0)
{
MessageBox.Show("執行檔已存在,請重新選擇。");
return;
}
ltExes.Items.Add(fdJetExe.FileName);
Program.UserSettings.JetPrintSettings.JetExecPaths.Add(fdJetExe.FileName);
}
}
private void btnRemove_Click(object sender, EventArgs e)
{
for (int num = ltExes.SelectedIndices.Count - 1; num >= 0; num--)
{
Program.UserSettings.JetPrintSettings.JetExecPaths.Remove(Convert.ToString(ltExes.Items[num]));
}
ltExes.ClearSelected();
UpdateLt();
}
private void frmJetExeList_Load(object sender, EventArgs e)
{
UpdateLt();
}
private void btnConfirm_Click(object sender, EventArgs e)
{
Close();
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(離線列印Client程式.frmJetExeList));
panelPrint = new System.Windows.Forms.Panel();
btnInsert = new System.Windows.Forms.Button();
btnRemove = new System.Windows.Forms.Button();
ltExes = new System.Windows.Forms.ListBox();
fdJetExe = new System.Windows.Forms.OpenFileDialog();
btnConfirm = new System.Windows.Forms.Button();
panelPrint.SuspendLayout();
SuspendLayout();
panelPrint.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
panelPrint.Controls.Add(btnConfirm);
panelPrint.Controls.Add(ltExes);
panelPrint.Controls.Add(btnRemove);
panelPrint.Controls.Add(btnInsert);
panelPrint.Location = new System.Drawing.Point(6, 7);
panelPrint.Name = "panelPrint";
panelPrint.Size = new System.Drawing.Size(482, 360);
panelPrint.TabIndex = 3;
btnInsert.Font = new System.Drawing.Font("新細明體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
btnInsert.Location = new System.Drawing.Point(159, 4);
btnInsert.Name = "btnInsert";
btnInsert.Size = new System.Drawing.Size(75, 29);
btnInsert.TabIndex = 0;
btnInsert.Text = "新增";
btnInsert.UseVisualStyleBackColor = true;
btnInsert.Click += new System.EventHandler(btnInsert_Click);
btnRemove.Font = new System.Drawing.Font("新細明體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
btnRemove.Location = new System.Drawing.Point(240, 4);
btnRemove.Name = "btnRemove";
btnRemove.Size = new System.Drawing.Size(75, 29);
btnRemove.TabIndex = 1;
btnRemove.Text = "刪除";
btnRemove.UseVisualStyleBackColor = true;
btnRemove.Click += new System.EventHandler(btnRemove_Click);
ltExes.FormattingEnabled = true;
ltExes.HorizontalScrollbar = true;
ltExes.ItemHeight = 12;
ltExes.Location = new System.Drawing.Point(4, 39);
ltExes.Name = "ltExes";
ltExes.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
ltExes.Size = new System.Drawing.Size(469, 316);
ltExes.TabIndex = 2;
fdJetExe.Filter = "執行檔 (*.exe)|*.exe";
fdJetExe.Title = "請選擇噴墨執行檔";
btnConfirm.Font = new System.Drawing.Font("新細明體", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 136);
btnConfirm.Location = new System.Drawing.Point(398, 4);
btnConfirm.Name = "btnConfirm";
btnConfirm.Size = new System.Drawing.Size(75, 29);
btnConfirm.TabIndex = 3;
btnConfirm.Text = "確認";
btnConfirm.UseVisualStyleBackColor = true;
btnConfirm.Click += new System.EventHandler(btnConfirm_Click);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(493, 370);
base.Controls.Add(panelPrint);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
base.Name = "frmJetExeList";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
Text = "噴墨列印執行檔增修";
base.Load += new System.EventHandler(frmJetExeList_Load);
panelPrint.ResumeLayout(false);
ResumeLayout(false);
}
}