aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Program.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-07 17:30:14 -0500
committerMichael <[email protected]>2017-02-07 17:30:14 -0500
commit7a29121456747651bd27d75833e28d5f7d479a1e (patch)
treed606abe06064c29b9796a9f958a3f953ec4e2c31 /ShiftOS.WinForms/Program.cs
parentaa45e10f4a023ba681f04bde72872c7e8a7aa122 (diff)
downloadshiftos_thereturn-7a29121456747651bd27d75833e28d5f7d479a1e.tar.gz
shiftos_thereturn-7a29121456747651bd27d75833e28d5f7d479a1e.tar.bz2
shiftos_thereturn-7a29121456747651bd27d75833e28d5f7d479a1e.zip
Added defaulticonattribute.
Diffstat (limited to 'ShiftOS.WinForms/Program.cs')
-rw-r--r--ShiftOS.WinForms/Program.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/Program.cs b/ShiftOS.WinForms/Program.cs
index 0ed5b02..06f495f 100644
--- a/ShiftOS.WinForms/Program.cs
+++ b/ShiftOS.WinForms/Program.cs
@@ -33,6 +33,7 @@ using Newtonsoft.Json;
using static ShiftOS.Objects.ShiftFS.Utils;
using ShiftOS.WinForms.Applications;
using ShiftOS.WinForms.Tools;
+using System.Reflection;
namespace ShiftOS.WinForms
{
@@ -71,6 +72,26 @@ namespace ShiftOS.WinForms
}
}
+ internal class ShiftOSIconProvider : IIconProber
+ {
+ public Image GetIcon(DefaultIconAttribute attr)
+ {
+
+ var res = typeof(Properties.Resources);
+ foreach(var prop in res.GetProperties(BindingFlags.NonPublic | BindingFlags.Static))
+ {
+ if(prop.PropertyType.BaseType == typeof(Image))
+ {
+ if(prop.Name == attr.ID)
+ {
+ return prop.GetValue(null) as Image;
+ }
+ }
+ }
+ return new Bitmap(16, 16);
+ }
+ }
+
internal class WinformsShiftoriumProvider : IShiftoriumProvider
{
public List<ShiftoriumUpgrade> GetDefaults()