diff options
| author | Michael <[email protected]> | 2017-04-23 14:53:10 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-04-23 14:53:10 -0400 |
| commit | e833a9bf2751f16d8614af9aa20f5b9bec3d81a8 (patch) | |
| tree | 2bed17163caeb9f417394d91b741d6c7d6766a8c /ShiftOS.WinForms/Program.cs | |
| parent | ba0ae29bbb7eee83c5a4969316d97b43b5f18ba0 (diff) | |
| download | shiftos_thereturn-e833a9bf2751f16d8614af9aa20f5b9bec3d81a8.tar.gz shiftos_thereturn-e833a9bf2751f16d8614af9aa20f5b9bec3d81a8.tar.bz2 shiftos_thereturn-e833a9bf2751f16d8614af9aa20f5b9bec3d81a8.zip | |
FUCKTONS OF SHIFTORIUM WORK
Diffstat (limited to 'ShiftOS.WinForms/Program.cs')
| -rw-r--r-- | ShiftOS.WinForms/Program.cs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/ShiftOS.WinForms/Program.cs b/ShiftOS.WinForms/Program.cs index 36c9338..3343cb0 100644 --- a/ShiftOS.WinForms/Program.cs +++ b/ShiftOS.WinForms/Program.cs @@ -34,6 +34,7 @@ using static ShiftOS.Objects.ShiftFS.Utils; using ShiftOS.WinForms.Applications; using ShiftOS.WinForms.Tools; using System.Reflection; +using System.IO; namespace ShiftOS.WinForms { @@ -98,7 +99,37 @@ namespace ShiftOS.WinForms { public List<ShiftoriumUpgrade> GetDefaults() { - return JsonConvert.DeserializeObject<List<ShiftoriumUpgrade>>(Properties.Resources.Shiftorium); + var defaultList = JsonConvert.DeserializeObject<List<ShiftoriumUpgrade>>(Properties.Resources.Shiftorium); + + foreach(var exe in Directory.GetFiles(Environment.CurrentDirectory)) + { + if(exe.EndsWith(".exe") || exe.EndsWith(".dll")) + { + try + { + var asm = Assembly.LoadFile(exe); + foreach(var type in asm.GetTypes()) + { + var attrib = type.GetCustomAttributes(false).FirstOrDefault(x => x is AppscapeEntryAttribute) as AppscapeEntryAttribute; + if(attrib != null) + { + var upgrade = new ShiftoriumUpgrade + { + Id = attrib.Name.ToLower().Replace(" ", "_"), + Name = attrib.Name, + Description = attrib.Description, + Cost = attrib.Cost, + Category = attrib.Category, + Dependencies = (string.IsNullOrWhiteSpace(attrib.DependencyString)) ? "appscape_handled_nodisplay" : "appscape_handled_nodisplay;" + attrib.DependencyString + }; + defaultList.Add(upgrade); + } + } + } + catch { } + } + } + return defaultList; } } |
