diff options
| author | Michael <[email protected]> | 2017-02-16 17:14:18 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-16 17:14:23 -0500 |
| commit | e255c7fd47c2f6e2e12befdc8808e9db8cc8f0d2 (patch) | |
| tree | 4cac94bffe9d322899ee047d86b8a3f2ef57f419 /ShiftOS_TheReturn/Desktop.cs | |
| parent | 781351aefb5d4fe7d9770568506345156b605b9a (diff) | |
| download | shiftos_thereturn-e255c7fd47c2f6e2e12befdc8808e9db8cc8f0d2.tar.gz shiftos_thereturn-e255c7fd47c2f6e2e12befdc8808e9db8cc8f0d2.tar.bz2 shiftos_thereturn-e255c7fd47c2f6e2e12befdc8808e9db8cc8f0d2.zip | |
stuff
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(); |
