Changeset 14881
- Timestamp:
- 04/21/17 07:12:31 (8 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14287,14297
- Property svn:mergeinfo changed
-
stable/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs
r14186 r14881 141 141 142 142 private void UpdateProgressValue() { 143 if (InvokeRequired) Invoke((Action)UpdateProgressValue); 144 else { 143 // prevent problems with object disposal and invoke as suggested by http://stackoverflow.com/a/18647091 144 if (!IsHandleCreated) return; 145 if (InvokeRequired) { 146 try { 147 Invoke((Action)UpdateProgressValue); 148 } 149 catch (InvalidOperationException) { 150 // swallow ObjectDisposedException 151 // which might occur if the invoke call is executed after or while the control is disposing 152 } 153 } else { 145 154 if (content != null) { 146 155 double progressValue = content.ProgressValue; … … 149 158 } else { 150 159 progressBar.Style = ProgressBarStyle.Blocks; 151 progressBar.Value = (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum)); 160 progressBar.Value = 161 (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum)); 152 162 } 153 163 }
Note: See TracChangeset
for help on using the changeset viewer.