aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-02 08:52:55 -0500
committerMichael <[email protected]>2017-03-02 08:53:01 -0500
commit6fa7a0837381e92ecca62faa19708b4d8a1e1515 (patch)
treee64c1f5d162d22a71ff47dfacdede9a7c9ddba5a /ShiftOS.WinForms
parent85068729a6ba7188f33723d6345b1a556c88c0ce (diff)
downloadshiftos_thereturn-6fa7a0837381e92ecca62faa19708b4d8a1e1515.tar.gz
shiftos_thereturn-6fa7a0837381e92ecca62faa19708b4d8a1e1515.tar.bz2
shiftos_thereturn-6fa7a0837381e92ecca62faa19708b4d8a1e1515.zip
Optimize screensavers
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/ScriptingTestFunctions.cs34
-rw-r--r--ShiftOS.WinForms/ShiftOS.WinForms.csproj1
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs20
3 files changed, 49 insertions, 6 deletions
diff --git a/ShiftOS.WinForms/ScriptingTestFunctions.cs b/ShiftOS.WinForms/ScriptingTestFunctions.cs
new file mode 100644
index 0000000..745f0ca
--- /dev/null
+++ b/ShiftOS.WinForms/ScriptingTestFunctions.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ShiftOS.Engine.Scripting;
+
+namespace ShiftOS.WinForms
+{
+ [Exposed("scriptingtests")]
+ public class ScriptingTestFunctions
+ {
+ public int testVar = 127;
+
+ public void testFunction()
+ {
+ Console.WriteLine("testFunction() called.");
+ }
+
+ public string testFunctionWithReturn(string arg)
+ {
+ return arg + "!";
+ }
+
+ public event Action testEvent;
+
+ public string testProperty { get; set; }
+
+ public void invokeTestEvent()
+ {
+ testEvent?.Invoke();
+ }
+ }
+}
diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
index 3cc9541..61174dc 100644
--- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj
+++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
@@ -256,6 +256,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
+ <Compile Include="ScriptingTestFunctions.cs" />
<Compile Include="ShiftOSAudioProvider.cs" />
<Compile Include="ShiftOSConfigFile.cs" />
<Compile Include="Tools\ColorPickerDataBackend.cs" />
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index 70910d8..42fe2c2 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -171,15 +171,22 @@ namespace ShiftOS.WinForms
public void HideScreensaver()
{
- this.Invoke(new Action(() =>
+ if (ResetDesktop == true)
{
- this.TopMost = false;
- pnlscreensaver.Hide();
- Cursor.Show();
- SetupDesktop();
- }));
+ this.Invoke(new Action(() =>
+ {
+ this.TopMost = false;
+ pnlscreensaver.Hide();
+ Cursor.Show();
+ SetupDesktop();
+ ResetDesktop = false;
+
+ }));
+ }
}
+ private bool ResetDesktop = false;
+
private void ShowScreensaver()
{
if (Shiftorium.UpgradeInstalled("screensavers"))
@@ -215,6 +222,7 @@ namespace ShiftOS.WinForms
Thread.Sleep(5000);
}
+ ResetDesktop = true;
});
t.IsBackground = true;
t.Start();