- Timestamp:
- 07/23/17 11:17:18 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Async/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 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.