Changeset 212
- Timestamp:
- 3/11/2008 2:51:24 AM (5 years ago)
- Location:
- branches/eraser6/Eraser
- Files:
-
- 3 edited
-
ProgressForm.Designer.cs (modified) (9 diffs)
-
ProgressForm.cs (modified) (1 diff)
-
ProgressForm.resx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/ProgressForm.Designer.cs
r78 r212 30 30 { 31 31 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProgressForm)); 32 this. totalProgressLbl = new System.Windows.Forms.Label();33 this. totalProgressPb= new System.Windows.Forms.ProgressBar();34 this.jobTitle Lbl= new System.Windows.Forms.Label();32 this.overallProgressLbl = new System.Windows.Forms.Label(); 33 this.overallProgress = new System.Windows.Forms.ProgressBar(); 34 this.jobTitle = new System.Windows.Forms.Label(); 35 35 this.status = new System.Windows.Forms.Label(); 36 36 this.statusLbl = new System.Windows.Forms.Label(); … … 39 39 this.passLbl = new System.Windows.Forms.Label(); 40 40 this.pass = new System.Windows.Forms.Label(); 41 this.methodLbl = new System.Windows.Forms.Label(); 42 this.method = new System.Windows.Forms.Label(); 43 this.titlePic = new System.Windows.Forms.PictureBox(); 41 this.title = new System.Windows.Forms.PictureBox(); 44 42 this.titleLbl = new System.Windows.Forms.Label(); 45 this.itemP bLbl = new System.Windows.Forms.Label();46 this.itemP b= new System.Windows.Forms.ProgressBar();47 this.stop Btn= new System.Windows.Forms.Button();43 this.itemProgressLbl = new System.Windows.Forms.Label(); 44 this.itemProgress = new System.Windows.Forms.ProgressBar(); 45 this.stop = new System.Windows.Forms.Button(); 48 46 this.bevelLine1 = new Trustbridge.Windows.Controls.BevelLine(); 49 47 this.bevelLine2 = new Trustbridge.Windows.Controls.BevelLine(); 50 ((System.ComponentModel.ISupportInitialize)(this.title Pic)).BeginInit();48 ((System.ComponentModel.ISupportInitialize)(this.title)).BeginInit(); 51 49 this.SuspendLayout(); 52 50 // 53 // totalProgressLbl54 // 55 this. totalProgressLbl.Location = new System.Drawing.Point(6, 174);56 this. totalProgressLbl.Name = "totalProgressLbl";57 this. totalProgressLbl.Size = new System.Drawing.Size(128, 15);58 this. totalProgressLbl.TabIndex = 0;59 this. totalProgressLbl.Text = "Total: 75%";60 this. totalProgressLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;61 // 62 // totalProgressPb63 // 64 this. totalProgressPb.Location = new System.Drawing.Point(6, 192);65 this. totalProgressPb.Name = "totalProgressPb";66 this. totalProgressPb.Size = new System.Drawing.Size(129, 15);67 this. totalProgressPb.TabIndex = 1;68 this. totalProgressPb.Value = 75;69 // 70 // jobTitle Lbl71 // 72 this.jobTitle Lbl.AutoSize = true;73 this.jobTitle Lbl.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));74 this.jobTitle Lbl.Location = new System.Drawing.Point(149, 8);75 this.jobTitle Lbl.Name = "jobTitleLbl";76 this.jobTitle Lbl.Size = new System.Drawing.Size(180, 15);77 this.jobTitle Lbl.TabIndex = 2;78 this.jobTitle Lbl.Text = "C:\\Users\\Joel Low\\Documents\\";51 // overallProgressLbl 52 // 53 this.overallProgressLbl.Location = new System.Drawing.Point(6, 174); 54 this.overallProgressLbl.Name = "overallProgressLbl"; 55 this.overallProgressLbl.Size = new System.Drawing.Size(128, 15); 56 this.overallProgressLbl.TabIndex = 0; 57 this.overallProgressLbl.Text = "Total: 75%"; 58 this.overallProgressLbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 59 // 60 // overallProgress 61 // 62 this.overallProgress.Location = new System.Drawing.Point(6, 192); 63 this.overallProgress.Name = "overallProgress"; 64 this.overallProgress.Size = new System.Drawing.Size(129, 15); 65 this.overallProgress.TabIndex = 1; 66 this.overallProgress.Value = 75; 67 // 68 // jobTitle 69 // 70 this.jobTitle.AutoSize = true; 71 this.jobTitle.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 72 this.jobTitle.Location = new System.Drawing.Point(149, 8); 73 this.jobTitle.Name = "jobTitle"; 74 this.jobTitle.Size = new System.Drawing.Size(180, 15); 75 this.jobTitle.TabIndex = 2; 76 this.jobTitle.Text = "C:\\Users\\Joel Low\\Documents\\"; 79 77 // 80 78 // status … … 133 131 this.pass.Text = "7 of 35 (15 seconds left)"; 134 132 // 135 // methodLbl 136 // 137 this.methodLbl.AutoSize = true; 138 this.methodLbl.Location = new System.Drawing.Point(149, 99); 139 this.methodLbl.Name = "methodLbl"; 140 this.methodLbl.Size = new System.Drawing.Size(52, 15); 141 this.methodLbl.TabIndex = 9; 142 this.methodLbl.Text = "Method:"; 143 // 144 // method 145 // 146 this.method.AutoSize = true; 147 this.method.Location = new System.Drawing.Point(215, 99); 148 this.method.Name = "method"; 149 this.method.Size = new System.Drawing.Size(57, 15); 150 this.method.TabIndex = 10; 151 this.method.Text = "Gutmann"; 152 // 153 // titlePic 154 // 155 this.titlePic.Image = ((System.Drawing.Image)(resources.GetObject("titlePic.Image"))); 156 this.titlePic.Location = new System.Drawing.Point(6, 33); 157 this.titlePic.Name = "titlePic"; 158 this.titlePic.Size = new System.Drawing.Size(128, 128); 159 this.titlePic.TabIndex = 11; 160 this.titlePic.TabStop = false; 133 // title 134 // 135 this.title.Image = ((System.Drawing.Image)(resources.GetObject("title.Image"))); 136 this.title.Location = new System.Drawing.Point(6, 33); 137 this.title.Name = "title"; 138 this.title.Size = new System.Drawing.Size(128, 128); 139 this.title.TabIndex = 11; 140 this.title.TabStop = false; 161 141 // 162 142 // titleLbl … … 170 150 this.titleLbl.TextAlign = System.Drawing.ContentAlignment.TopCenter; 171 151 // 172 // itemP bLbl173 // 174 this.itemP bLbl.AutoSize = true;175 this.itemP bLbl.Location = new System.Drawing.Point(413, 138);176 this.itemP bLbl.Name = "itemPbLbl";177 this.itemP bLbl.Size = new System.Drawing.Size(29, 15);178 this.itemP bLbl.TabIndex = 13;179 this.itemP bLbl.Text = "97%";180 // 181 // itemP b182 // 183 this.itemP b.Location = new System.Drawing.Point(150, 137);184 this.itemP b.Name = "itemPb";185 this.itemP b.Size = new System.Drawing.Size(257, 17);186 this.itemP b.TabIndex = 14;187 this.itemP b.Value = 97;188 // 189 // stop Btn190 // 191 this.stop Btn.Location = new System.Drawing.Point(367, 184);192 this.stop Btn.Name = "stopBtn";193 this.stop Btn.Size = new System.Drawing.Size(75, 23);194 this.stop Btn.TabIndex = 17;195 this.stop Btn.Text = "Stop";196 this.stop Btn.UseVisualStyleBackColor = true;152 // itemProgressLbl 153 // 154 this.itemProgressLbl.AutoSize = true; 155 this.itemProgressLbl.Location = new System.Drawing.Point(413, 138); 156 this.itemProgressLbl.Name = "itemProgressLbl"; 157 this.itemProgressLbl.Size = new System.Drawing.Size(29, 15); 158 this.itemProgressLbl.TabIndex = 13; 159 this.itemProgressLbl.Text = "97%"; 160 // 161 // itemProgress 162 // 163 this.itemProgress.Location = new System.Drawing.Point(150, 137); 164 this.itemProgress.Name = "itemProgress"; 165 this.itemProgress.Size = new System.Drawing.Size(257, 17); 166 this.itemProgress.TabIndex = 14; 167 this.itemProgress.Value = 97; 168 // 169 // stop 170 // 171 this.stop.Location = new System.Drawing.Point(367, 184); 172 this.stop.Name = "stop"; 173 this.stop.Size = new System.Drawing.Size(75, 23); 174 this.stop.TabIndex = 17; 175 this.stop.Text = "Stop"; 176 this.stop.UseVisualStyleBackColor = true; 197 177 // 198 178 // bevelLine1 … … 213 193 this.bevelLine2.TabIndex = 20; 214 194 // 215 // MainForm195 // ProgressForm 216 196 // 217 197 this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); … … 220 200 this.Controls.Add(this.bevelLine2); 221 201 this.Controls.Add(this.bevelLine1); 222 this.Controls.Add(this.stop Btn);223 this.Controls.Add(this.itemP b);224 this.Controls.Add(this.itemP bLbl);202 this.Controls.Add(this.stop); 203 this.Controls.Add(this.itemProgress); 204 this.Controls.Add(this.itemProgressLbl); 225 205 this.Controls.Add(this.titleLbl); 226 this.Controls.Add(this.titlePic); 227 this.Controls.Add(this.method); 228 this.Controls.Add(this.methodLbl); 206 this.Controls.Add(this.title); 229 207 this.Controls.Add(this.pass); 230 208 this.Controls.Add(this.passLbl); … … 233 211 this.Controls.Add(this.statusLbl); 234 212 this.Controls.Add(this.status); 235 this.Controls.Add(this.jobTitle Lbl);236 this.Controls.Add(this. totalProgressPb);237 this.Controls.Add(this. totalProgressLbl);213 this.Controls.Add(this.jobTitle); 214 this.Controls.Add(this.overallProgress); 215 this.Controls.Add(this.overallProgressLbl); 238 216 this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 239 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 240 this.Name = "MainForm"; 241 this.Text = "Eraser - Erasing"; 242 ((System.ComponentModel.ISupportInitialize)(this.titlePic)).EndInit(); 217 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 218 this.MaximizeBox = false; 219 this.MinimizeBox = false; 220 this.Name = "ProgressForm"; 221 this.ShowInTaskbar = false; 222 this.Text = "Erasure Progress"; 223 ((System.ComponentModel.ISupportInitialize)(this.title)).EndInit(); 243 224 this.ResumeLayout(false); 244 225 this.PerformLayout(); … … 248 229 #endregion 249 230 250 private System.Windows.Forms.Label totalProgressLbl;251 private System.Windows.Forms.ProgressBar totalProgressPb;252 private System.Windows.Forms.Label jobTitle Lbl;231 private System.Windows.Forms.Label overallProgressLbl; 232 private System.Windows.Forms.ProgressBar overallProgress; 233 private System.Windows.Forms.Label jobTitle; 253 234 private System.Windows.Forms.Label status; 254 235 private System.Windows.Forms.Label statusLbl; … … 257 238 private System.Windows.Forms.Label passLbl; 258 239 private System.Windows.Forms.Label pass; 259 private System.Windows.Forms.Label methodLbl; 260 private System.Windows.Forms.Label method; 261 private System.Windows.Forms.PictureBox titlePic; 240 private System.Windows.Forms.PictureBox title; 262 241 private System.Windows.Forms.Label titleLbl; 263 private System.Windows.Forms.Label itemP bLbl;264 private System.Windows.Forms.ProgressBar itemP b;265 private System.Windows.Forms.Button stop Btn;242 private System.Windows.Forms.Label itemProgressLbl; 243 private System.Windows.Forms.ProgressBar itemProgress; 244 private System.Windows.Forms.Button stop; 266 245 private Trustbridge.Windows.Controls.BevelLine bevelLine1; 267 246 private Trustbridge.Windows.Controls.BevelLine bevelLine2; -
branches/eraser6/Eraser/ProgressForm.cs
r94 r212 7 7 using System.Windows.Forms; 8 8 9 using Eraser.Manager; 10 9 11 namespace Eraser 10 12 { 11 13 public partial class ProgressForm : Form 12 14 { 13 public ProgressForm() 15 private Task task; 16 17 public ProgressForm(Task task) 14 18 { 15 19 InitializeComponent(); 20 this.task = task; 21 22 //Register the event handlers 23 jobTitle.Text = task.UIText; 24 task.ProgressChanged += new Task.ProgressEventFunction(task_ProgressChanged); 25 task.TaskFinished += new Task.TaskEventFunction(task_TaskFinished); 26 } 27 28 ~ProgressForm() 29 { 30 task.ProgressChanged -= new Task.ProgressEventFunction(task_ProgressChanged); 31 task.TaskFinished -= new Task.TaskEventFunction(task_TaskFinished); 32 } 33 34 void task_ProgressChanged(TaskProgressEventArgs e) 35 { 36 if (InvokeRequired) 37 { 38 Task.ProgressEventFunction func = 39 new Task.ProgressEventFunction(task_ProgressChanged); 40 Invoke(func, new object[] {e}); 41 return; 42 } 43 44 item.Text = e.CurrentItemName; 45 pass.Text = string.Format("{0} out of {1} ({2} seconds left)", 46 e.CurrentPass, e.TotalPasses, 0); 47 48 itemProgress.Value = e.CurrentItemProgress; 49 itemProgressLbl.Text = string.Format("{0}%", e.CurrentItemProgress); 50 overallProgress.Value = e.OverallProgress; 51 overallProgressLbl.Text = string.Format("Total: {0}%", e.OverallProgress); 52 } 53 54 void task_TaskFinished(TaskEventArgs e) 55 { 56 if (InvokeRequired) 57 { 58 Task.TaskEventFunction func = 59 new Task.TaskEventFunction(task_TaskFinished); 60 Invoke(func, new object[] { e }); 61 return; 62 } 63 64 //Inform the user on the status of the task. 65 status.Text = "Completed."; 66 LogLevel highestLevel = LogLevel.INFORMATION; 67 foreach (LogEntry log in e.Task.Log) 68 if (log.Level > highestLevel) 69 highestLevel = log.Level; 70 71 switch (highestLevel) 72 { 73 case LogLevel.WARNING: 74 status.Text += " with warnings."; 75 break; 76 case LogLevel.ERROR: 77 status.Text += " with errors."; 78 break; 79 case LogLevel.FATAL: 80 status.Text = "Not completed."; 81 break; 82 default: 83 status.Text += "."; 84 break; 85 } 16 86 } 17 87 } -
branches/eraser6/Eraser/ProgressForm.resx
r78 r212 119 119 </resheader> 120 120 <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 121 <data name="title Pic.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">121 <data name="title.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> 122 122 <value> 123 123 iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
Note: See TracChangeset
for help on using the changeset viewer.
