Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3235


Ignore:
Timestamp:
03/30/10 17:37:42 (14 years ago)
Author:
mkommend
Message:

corrected ItemView (ticket #953)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemView.cs

    r3228 r3235  
    5858      }
    5959    }
    60 
    61     /// <summary>
    62     /// Asynchron call of GUI updating.
    63     /// </summary>
    64     /// <param name="method">The delegate to invoke.</param>
    65     protected new void Invoke(Delegate method) {
    66       // enforce context switch to improve GUI response time
    67       IAsyncResult res = base.BeginInvoke(method);
    68       ThreadPool.RegisterWaitForSingleObject(res.AsyncWaitHandle,
    69         new WaitOrTimerCallback((x, b) => { EndInvoke(res); }),
    70         null, -1, true);
    71       // prevent blocking of worker thread in Invoke, if the control is disposed
    72       //IAsyncResult result = BeginInvoke(method);
    73       //while ((!result.AsyncWaitHandle.WaitOne(100, false)) && (!IsDisposed)) {
    74       //  System.Threading.Thread.Sleep(0);
    75       //}
    76       //if (!IsDisposed) EndInvoke(result);
    77     }
    78     /// <summary>
    79     /// Asynchron call of GUI updating.
    80     /// </summary>
    81     /// <param name="method">The delegate to invoke.</param>
    82     /// <param name="args">The invoke arguments.</param>
    83     protected new void Invoke(Delegate method, params object[] args) {
    84       // enforce context switch to improve GUI response time
    85       IAsyncResult res = base.BeginInvoke(method, args);
    86       ThreadPool.RegisterWaitForSingleObject(res.AsyncWaitHandle,
    87         new WaitOrTimerCallback((x, b) => { EndInvoke(res); }),
    88         null, -1, true);
    89       //base.Invoke(method, args);
    90       //System.Threading.Thread.Sleep(0);
    91 
    92       //// prevent blocking of worker thread in Invoke, if the control is disposed
    93       //IAsyncResult result = BeginInvoke(method, args);
    94       //while ((!result.AsyncWaitHandle.WaitOne(100, false)) && (!IsDisposed)) { }
    95       //if (!IsDisposed) EndInvoke(result);
    96     }
    9760  }
    9861}
Note: See TracChangeset for help on using the changeset viewer.