aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Tools/ControlManager.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-26 17:06:38 -0400
committerMichael <[email protected]>2017-05-26 17:06:38 -0400
commit97e22b35ada5898fdcb2556628f764d927cff913 (patch)
tree88f40abbed43100bb393083ccecc81893a2447f7 /ShiftOS.WinForms/Tools/ControlManager.cs
parent798f0e5920fb5dc564cf6adab60e3c909197e736 (diff)
downloadshiftos_thereturn-97e22b35ada5898fdcb2556628f764d927cff913.tar.gz
shiftos_thereturn-97e22b35ada5898fdcb2556628f764d927cff913.tar.bz2
shiftos_thereturn-97e22b35ada5898fdcb2556628f764d927cff913.zip
SLIGHT optimizations?
Diffstat (limited to 'ShiftOS.WinForms/Tools/ControlManager.cs')
-rw-r--r--ShiftOS.WinForms/Tools/ControlManager.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/ShiftOS.WinForms/Tools/ControlManager.cs b/ShiftOS.WinForms/Tools/ControlManager.cs
index fc9567d..1643b23 100644
--- a/ShiftOS.WinForms/Tools/ControlManager.cs
+++ b/ShiftOS.WinForms/Tools/ControlManager.cs
@@ -144,10 +144,7 @@ namespace ShiftOS.WinForms.Tools
public static void SetupControl(Control ctrl)
{
- Desktop.InvokeOnWorkerThread(new Action(() =>
- {
- ctrl.SuspendLayout();
- }));
+
if (!(ctrl is MenuStrip) && !(ctrl is ToolStrip) && !(ctrl is StatusStrip) && !(ctrl is ContextMenuStrip))
{
string tag = "";
@@ -306,7 +303,6 @@ namespace ShiftOS.WinForms.Tools
{
MakeDoubleBuffered(ctrl);
- ctrl.ResumeLayout();
});
ControlSetup?.Invoke(ctrl);
}
@@ -330,17 +326,18 @@ namespace ShiftOS.WinForms.Tools
public static void SetupControls(Control frm, bool runInThread = true)
{
- SetupControl(frm);
frm.Click += (o, a) =>
{
Desktop.HideAppLauncher();
};
ThreadStart ts = () =>
{
- for (int i = 0; i < frm.Controls.Count; i++)
+ var ctrls = frm.Controls.ToList();
+ for (int i = 0; i < ctrls.Count(); i++)
{
- SetupControls(frm.Controls[i], false);
+ SetupControls(ctrls[i]);
}
+ SetupControl(frm);
};