Changeset 3329 for trunk/sources/HeuristicLab.MainForm.WindowsForms
- Timestamp:
- 04/13/10 17:07:10 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/AsynchronousContentView.cs
r3266 r3329 25 25 /// <param name="method">The delegate to invoke.</param> 26 26 protected new void Invoke(Delegate method) { 27 // prevent blocking of worker thread in Invoke, if the control is disposed 27 // prevents blocking of worker thread in Invoke, if the control is disposed 28 if (!IsHandleCreated) 29 return; 28 30 IAsyncResult result = BeginInvoke(method); 29 31 result.AsyncWaitHandle.WaitOne(1000, false); 30 if (result.IsCompleted) try { EndInvoke(result); } catch (ObjectDisposedException) { }31 else {32 if (result.IsCompleted) try { EndInvoke(result); } 33 catch (ObjectDisposedException) { } else { 32 34 ThreadPool.RegisterWaitForSingleObject(result.AsyncWaitHandle, 33 35 new WaitOrTimerCallback((x, b) => { try { EndInvoke(result); } catch (ObjectDisposedException) { } }), … … 42 44 /// <param name="args">The invoke arguments.</param> 43 45 protected new void Invoke(Delegate method, params object[] args) { 44 // prevent blocking of worker thread in Invoke, if the control is disposed 46 // prevents blocking of worker thread in Invoke, if the control is disposed 47 if (!IsHandleCreated) 48 return; 45 49 IAsyncResult result = BeginInvoke(method, args); 46 50 result.AsyncWaitHandle.WaitOne(1000, false);
Note: See TracChangeset
for help on using the changeset viewer.