aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Desktop.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-18 10:37:11 -0500
committerMichael <[email protected]>2017-02-18 10:37:11 -0500
commit9b8d5861a954610713ae66a53d2ac067991d9b68 (patch)
treee550f758e52ec8ca12357d91c9fa13907e70c4f3 /ShiftOS_TheReturn/Desktop.cs
parent30823a0778614d0f9fd6f82b5d9eb03aab41280d (diff)
downloadshiftos_thereturn-9b8d5861a954610713ae66a53d2ac067991d9b68.tar.gz
shiftos_thereturn-9b8d5861a954610713ae66a53d2ac067991d9b68.tar.bz2
shiftos_thereturn-9b8d5861a954610713ae66a53d2ac067991d9b68.zip
WHOA LUA STUFF :dancer:
Diffstat (limited to 'ShiftOS_TheReturn/Desktop.cs')
-rw-r--r--ShiftOS_TheReturn/Desktop.cs35
1 files changed, 10 insertions, 25 deletions
diff --git a/ShiftOS_TheReturn/Desktop.cs b/ShiftOS_TheReturn/Desktop.cs
index d30e3c3..86d2099 100644
--- a/ShiftOS_TheReturn/Desktop.cs
+++ b/ShiftOS_TheReturn/Desktop.cs
@@ -85,45 +85,30 @@ namespace ShiftOS.Engine
void RestoreWindow(IWindowBorder brdr);
void InvokeOnWorkerThread(Action act);
Size GetSize();
+
+ void Show();
+ void Close();
}
public static class Desktop
{
private static IDesktop _desktop = null;
- public static IDesktop[] GetAllDesktops()
- {
- List<IDesktop> desktops = new List<IDesktop>();
- foreach(var exe in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
- {
- if(exe.EndsWith(".exe") || exe.EndsWith(".dll"))
- {
- try
- {
- var asm = Assembly.LoadFile(exe);
- foreach(var type in asm.GetTypes())
- {
- if (type.GetInterfaces().Contains(typeof(IDesktop)))
- {
- desktops.Add(Activator.CreateInstance(type) as IDesktop);
- }
- }
- }
- catch { }
- }
- }
- return desktops.ToArray();
- }
-
public static Size Size { get
{
return _desktop.GetSize();
}
}
- public static void Init(IDesktop desk)
+ public static void Init(IDesktop desk, bool show = false)
{
+ IDesktop deskToClose = null;
+ if (_desktop != null)
+ deskToClose = _desktop;
_desktop = desk;
+ if (show == true)
+ _desktop.Show();
+ deskToClose?.Close();
}
public static void MinimizeWindow(IWindowBorder brdr)