mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Optimize screensavers
This commit is contained in:
parent
85068729a6
commit
6fa7a08373
3 changed files with 49 additions and 6 deletions
34
ShiftOS.WinForms/ScriptingTestFunctions.cs
Normal file
34
ShiftOS.WinForms/ScriptingTestFunctions.cs
Normal file
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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" />
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue