Changeset 3398 for trunk/sources
- Timestamp:
- 04/18/10 04:33:20 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ControlExtensions.cs
r3177 r3398 32 32 33 33 public static void SuspendRepaint(this Control control) { 34 SendMessage(control.Handle, WM_SETREDRAW, false, 0); 34 if (control.InvokeRequired) 35 control.Invoke((Action<Control>)((c) => { c.SuspendRepaint(); })); 36 else 37 SendMessage(control.Handle, WM_SETREDRAW, false, 0); 35 38 } 36 39 public static void ResumeRepaint(this Control control, bool refresh) { 37 SendMessage(control.Handle, WM_SETREDRAW, true, 0); 38 if (refresh) control.Refresh(); 40 if (control.InvokeRequired) 41 control.Invoke((Action<Control, bool>)((c, b) => { c.ResumeRepaint(b); })); 42 else { 43 SendMessage(control.Handle, WM_SETREDRAW, true, 0); 44 if (refresh) control.Refresh(); 45 } 39 46 } 40 47 } -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs
r3395 r3398 70 70 IContentView contentView = view as IContentView; 71 71 if (ShowViewsInViewHost && contentView != null && contentView.GetType() != typeof(ViewHost)) { 72 ViewHost viewHost = new ViewHost(contentView .Content);72 ViewHost viewHost = new ViewHost(contentView); 73 73 form = new DockForm(viewHost); 74 74 } else -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs
r3395 r3398 76 76 IContentView contentView = view as IContentView; 77 77 if (ShowViewsInViewHost && contentView != null && contentView.GetType() != typeof(ViewHost)) { 78 ViewHost viewHost = new ViewHost(contentView .Content);78 ViewHost viewHost = new ViewHost(contentView); 79 79 form = new DocumentForm(viewHost); 80 80 } else -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs
r3395 r3398 70 70 IContentView contentView = view as IContentView; 71 71 if (ShowViewsInViewHost && contentView != null && contentView.GetType() != typeof(ViewHost)) { 72 ViewHost viewHost = new ViewHost(contentView .Content);72 ViewHost viewHost = new ViewHost(contentView); 73 73 form = new DocumentForm(viewHost); 74 74 } else -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/View.cs
r3354 r3398 58 58 public virtual bool ReadOnly { 59 59 get { return this.readOnly; } 60 60 set { 61 61 if (InvokeRequired) { 62 62 Action<bool> action = delegate(bool b) { this.ReadOnly = b; }; … … 208 208 209 209 public void SuspendRepaint() { 210 ((Control)this).SuspendRepaint(); 210 if (InvokeRequired) 211 Invoke((MethodInvoker)SuspendRepaint); 212 else 213 ((Control)this).SuspendRepaint(); 211 214 } 212 215 public void ResumeRepaint(bool refresh) { 216 if (InvokeRequired) 217 Invoke((Action<bool>)ResumeRepaint,refresh); 218 else 213 219 ((Control)this).ResumeRepaint(refresh); 214 220 } -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.cs
r3394 r3398 28 28 namespace HeuristicLab.MainForm.WindowsForms { 29 29 [Content(typeof(object))] 30 public sealed partial class ViewHost : ContentView {30 public sealed partial class ViewHost : AsynchronousContentView { 31 31 private Dictionary<Type, IContentView> cachedViews; 32 32 public ViewHost() { … … 41 41 : this() { 42 42 this.Content = content; 43 } 44 45 public ViewHost(IContentView contentView) :this(){ 46 this.viewType = contentView.GetType(); 47 this.Content = contentView.Content; 48 this.cachedViews.Add(contentView.GetType(), contentView); 49 this.UpdateView(); 43 50 } 44 51 … … 88 95 viewsLabel.Visible = false; 89 96 viewPanel.Visible = false; 90 if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose();91 viewPanel.Controls.Clear();92 97 93 98 if (Content != null) {
Note: See TracChangeset
for help on using the changeset viewer.