Changeset 1659 for branches/eraser6/6.0
- Timestamp:
- 1/25/2010 2:35:37 AM (2 years ago)
- Location:
- branches/eraser6/6.0/Eraser
- Files:
-
- 2 edited
-
LogForm.cs (modified) (2 diffs)
-
ProgressForm.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/6.0/Eraser/LogForm.cs
r1360 r1659 77 77 private void task_NewSession(object sender, EventArgs e) 78 78 { 79 if (!IsHandleCreated) 80 return; 79 81 if (InvokeRequired) 80 82 { … … 88 90 private void task_Logged(object sender, LogEventArgs e) 89 91 { 92 if (!IsHandleCreated) 93 return; 90 94 if (InvokeRequired) 91 95 { -
branches/eraser6/6.0/Eraser/ProgressForm.cs
r1360 r1659 61 61 private void task_ProgressChanged(object sender, TaskProgressEventArgs e) 62 62 { 63 if (!IsHandleCreated) 64 return; 63 65 if (InvokeRequired) 64 66 { … … 102 104 private void task_TaskFinished(object sender, TaskEventArgs e) 103 105 { 106 if (!IsHandleCreated) 107 return; 104 108 if (InvokeRequired) 105 109 { … … 160 164 { 161 165 StringBuilder result = new StringBuilder(itemName.Length); 166 using (Graphics g = item.CreateGraphics()) 167 { 168 //Split the long file name into lines which fit into the width of the label 169 while (itemName.Length > 0) 170 { 171 int chars = 0; 172 int lines = 0; 173 g.MeasureString(itemName, item.Font, new SizeF(item.Width - 2, 15), 174 StringFormat.GenericDefault, out chars, out lines); 162 175 163 try 164 { 165 using (Graphics g = item.CreateGraphics()) 166 { 167 //Split the long file name into lines which fit into the width of the label 168 while (itemName.Length > 0) 169 { 170 int chars = 0; 171 int lines = 0; 172 g.MeasureString(itemName, item.Font, new SizeF(item.Width - 2, 15), 173 StringFormat.GenericDefault, out chars, out lines); 174 175 result.AppendLine(itemName.Substring(0, chars)); 176 itemName = itemName.Remove(0, chars); 177 } 176 result.AppendLine(itemName.Substring(0, chars)); 177 itemName = itemName.Remove(0, chars); 178 178 } 179 }180 catch (ObjectDisposedException)181 {182 //Called when the user closes the form and the delegate call to Invoke was queued.183 179 } 184 180
Note: See TracChangeset
for help on using the changeset viewer.
