Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3228


Ignore:
Timestamp:
03/28/10 18:05:58 (14 years ago)
Author:
mkommend
Message:

adapted all HL3.3 views to use the AsynchronousContentView (ticket #953)

Location:
trunk/sources
Files:
7 edited

Legend:

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

    r2949 r3228  
    3535  [Content(typeof(ItemArray<>), true)]
    3636  [Content(typeof(IObservableArray<>), false)]
    37   public partial class ItemArrayView<T> : ContentView where T : class, IItem {
     37  public partial class ItemArrayView<T> : AsynchronousContentView where T : class, IItem {
    3838    /// <summary>
    3939    /// Gets or sets the scope whose variables to represent visually.
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r2949 r3228  
    3131  [Content(typeof(ItemCollection<>), true)]
    3232  [Content(typeof(IObservableCollection<>), false)]
    33   public partial class ItemCollectionView<T> : ContentView where T : class, IItem {
     33  public partial class ItemCollectionView<T> : AsynchronousContentView where T : class, IItem {
    3434    public new IObservableCollection<T> Content {
    3535      get { return (IObservableCollection<T>)base.Content; }
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r2949 r3228  
    3535  [Content(typeof(ItemList<>), true)]
    3636  [Content(typeof(IObservableList<>), false)]
    37   public partial class ItemListView<T> : ContentView where T : class, IItem {
     37  public partial class ItemListView<T> : AsynchronousContentView where T : class, IItem {
    3838    /// <summary>
    3939    /// Gets or sets the scope whose variables to represent visually.
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemView.cs

    r2961 r3228  
    2323using HeuristicLab.MainForm;
    2424using HeuristicLab.MainForm.WindowsForms;
     25using System.Threading;
    2526
    2627namespace HeuristicLab.Core.Views {
     
    3132  [Content(typeof(Item), false)]
    3233  [Content(typeof(IItem), false)]
    33   public partial class ItemView : ContentView {
     34  public partial class ItemView : AsynchronousContentView {
    3435    public new IItem Content {
    3536      get { return (IItem)base.Content; }
     
    6465    protected new void Invoke(Delegate method) {
    6566      // enforce context switch to improve GUI response time
    66       System.Threading.Thread.Sleep(0);
    67 
     67      IAsyncResult res = base.BeginInvoke(method);
     68      ThreadPool.RegisterWaitForSingleObject(res.AsyncWaitHandle,
     69        new WaitOrTimerCallback((x, b) => { EndInvoke(res); }),
     70        null, -1, true);
    6871      // prevent blocking of worker thread in Invoke, if the control is disposed
    69       IAsyncResult result = BeginInvoke(method);
    70       while ((!result.AsyncWaitHandle.WaitOne(100, false)) && (!IsDisposed)) { }
    71       if (!IsDisposed) EndInvoke(result);
     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);
    7277    }
    7378    /// <summary>
     
    7883    protected new void Invoke(Delegate method, params object[] args) {
    7984      // enforce context switch to improve GUI response time
    80       System.Threading.Thread.Sleep(0);
     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);
    8191
    82       // prevent blocking of worker thread in Invoke, if the control is disposed
    83       IAsyncResult result = BeginInvoke(method, args);
    84       while ((!result.AsyncWaitHandle.WaitOne(100, false)) && (!IsDisposed)) { }
    85       if (!IsDisposed) EndInvoke(result);
     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);
    8696    }
    8797  }
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleArrayView.cs

    r3048 r3228  
    3131  [View("StringConvertibleArray View")]
    3232  [Content(typeof(IStringConvertibleArray), true)]
    33   public partial class StringConvertibleArrayView : ContentView {
     33  public partial class StringConvertibleArrayView : AsynchronousContentView {
    3434    public new IStringConvertibleArray Content {
    3535      get { return (IStringConvertibleArray)base.Content; }
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs

    r3048 r3228  
    3131  [View("StringConvertibleMatrix View")]
    3232  [Content(typeof(IStringConvertibleMatrix), true)]
    33   public partial class StringConvertibleMatrixView : ContentView {
     33  public partial class StringConvertibleMatrixView : AsynchronousContentView {
    3434    public new IStringConvertibleMatrix Content {
    3535      get { return (IStringConvertibleMatrix)base.Content; }
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleValueView.cs

    r3048 r3228  
    2929  [View("StringConvertibleValue View")]
    3030  [Content(typeof(IStringConvertibleValue), true)]
    31   public partial class StringConvertibleValueView : ContentView {
     31  public partial class StringConvertibleValueView : AsynchronousContentView {
    3232    public new IStringConvertibleValue Content {
    3333      get { return (IStringConvertibleValue)base.Content; }
Note: See TracChangeset for help on using the changeset viewer.