diff options
Diffstat (limited to 'ShiftOS_TheReturn/Desktop.cs')
| -rw-r--r-- | ShiftOS_TheReturn/Desktop.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/Desktop.cs b/ShiftOS_TheReturn/Desktop.cs index 712f05d..d30e3c3 100644 --- a/ShiftOS_TheReturn/Desktop.cs +++ b/ShiftOS_TheReturn/Desktop.cs @@ -32,6 +32,7 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using ShiftOS.Objects.ShiftFS; using static ShiftOS.Engine.SkinEngine; namespace ShiftOS.Engine @@ -72,6 +73,8 @@ namespace ShiftOS.Engine public interface IDesktop { + string DesktopName { get; } + void SetupDesktop(); void PopulateAppLauncher(LauncherItem[] items); void ShowWindow(IWindowBorder border); @@ -88,6 +91,30 @@ namespace ShiftOS.Engine { 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(); |
