diff options
| author | Rylan/wowmom98 <[email protected]> | 2017-02-04 12:22:11 -0500 |
|---|---|---|
| committer | Rylan/wowmom98 <[email protected]> | 2017-02-04 12:22:11 -0500 |
| commit | 6092cf1f9b56413ae0b7937f790b99046f2614be (patch) | |
| tree | 9758a9502e23b7b89b0af3d1abc0909b0a5c5cb5 /ShiftOS_TheReturn | |
| parent | 8a445f961e05c5b432053ff3209bcb9b70f4aa96 (diff) | |
| parent | 1f87bfe6c599e3c0e471096600a38647da263fa9 (diff) | |
| download | shiftos_thereturn-6092cf1f9b56413ae0b7937f790b99046f2614be.tar.gz shiftos_thereturn-6092cf1f9b56413ae0b7937f790b99046f2614be.tar.bz2 shiftos_thereturn-6092cf1f9b56413ae0b7937f790b99046f2614be.zip | |
Merge branch 'master' of https://github.com/shiftos-game/ShiftOS
Diffstat (limited to 'ShiftOS_TheReturn')
| -rw-r--r-- | ShiftOS_TheReturn/AppearanceManager.cs | 45 | ||||
| -rw-r--r-- | ShiftOS_TheReturn/Skinning.cs | 3 |
2 files changed, 48 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/AppearanceManager.cs b/ShiftOS_TheReturn/AppearanceManager.cs index dd205b2..112bca5 100644 --- a/ShiftOS_TheReturn/AppearanceManager.cs +++ b/ShiftOS_TheReturn/AppearanceManager.cs @@ -29,6 +29,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; @@ -75,6 +76,39 @@ namespace ShiftOS.Engine } } + public static IEnumerable<Type> GetAllWindowTypes() + { + List<Type> types = new List<Type>(); + foreach(var file in System.IO.Directory.GetFiles(Environment.CurrentDirectory)) + { + if(file.EndsWith(".exe") || file.EndsWith(".dll")) + { + try + { + var asm = Assembly.LoadFile(file); + foreach(var type in asm.GetTypes()) + { + if (type.GetInterfaces().Contains(typeof(IShiftOSWindow))) + types.Add(type); + } + } + catch { } + } + } + return types; + } + + public static string GetDefaultTitle(Type winType) + { + foreach(var attrib in winType.GetCustomAttributes(false)) + { + if(attrib is DefaultTitleAttribute) + { + return (attrib as DefaultTitleAttribute).Title; + } + } + return winType.Name; + } public static string LastTerminalText { get; set; } public static int CurrentPosition { get; set; } @@ -205,4 +239,15 @@ namespace ShiftOS.Engine string Text { get; set; } IShiftOSWindow ParentWindow { get; set; } } + + public class DefaultTitleAttribute : Attribute + { + public DefaultTitleAttribute(string title) + { + Title = title; + } + + public string Title { get; private set; } + } + } diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs index 80945b8..b3dddd3 100644 --- a/ShiftOS_TheReturn/Skinning.cs +++ b/ShiftOS_TheReturn/Skinning.cs @@ -137,6 +137,9 @@ namespace ShiftOS.Engine { return JsonConvert.SerializeObject(this, Formatting.Indented); } + [ShifterHidden] + public Dictionary<string, string> AppNames = new Dictionary<string, string>(); + [ShifterMeta("Windows")] [ShifterCategory("Titlebar")] [RequiresUpgrade("shift_title_text")] |
