Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/10 16:43:57 (14 years ago)
Author:
swagner
Message:

Moved extension methods of Control from HeuristicLab.Core.Views to HeuristicLab.MainForm.WindowsForms and suspended/resumed repainting in some controls to improve UI response times (#887).

Location:
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ControlExtensions.cs

    r3171 r3177  
    2121
    2222using System;
     23using System.Runtime.InteropServices;
    2324using System.Windows.Forms;
    24 using System.Runtime.InteropServices;
    2525
    26 namespace HeuristicLab.Core.Views {
     26namespace HeuristicLab.MainForm.WindowsForms {
    2727  public static class ControlExtensions {
    2828    [DllImport("user32.dll")]
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/HeuristicLab.MainForm.WindowsForms-3.2.csproj

    r2900 r3177  
    9393    </Compile>
    9494    <None Include="HeuristicLabMainFormWindowsFormsPlugin.cs.frame" />
     95    <Compile Include="ControlExtensions.cs" />
    9596    <Compile Include="DockForm.cs">
    9697      <SubType>Form</SubType>
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/View.cs

    r2962 r3177  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    28 using System.Xml;
    2923using System.Windows.Forms;
    3024
     
    161155    protected virtual void OnInitialized(EventArgs e) {
    162156    }
     157
     158    public new bool Enabled {
     159      get { return base.Enabled; }
     160      set {
     161        SuspendRepaint();
     162        base.Enabled = value;
     163        ResumeRepaint(true);
     164      }
     165    }
     166
     167    public void SuspendRepaint() {
     168      ((Control)this).SuspendRepaint();
     169    }
     170    public void ResumeRepaint(bool refresh) {
     171      ((Control)this).ResumeRepaint(refresh);
     172    }
    163173  }
    164174}
Note: See TracChangeset for help on using the changeset viewer.