diff options
Diffstat (limited to 'source/WindowsFormsApplication1/Apps/Shifter.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Apps/Shifter.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source/WindowsFormsApplication1/Apps/Shifter.cs b/source/WindowsFormsApplication1/Apps/Shifter.cs index ff618cb..3e16184 100644 --- a/source/WindowsFormsApplication1/Apps/Shifter.cs +++ b/source/WindowsFormsApplication1/Apps/Shifter.cs @@ -36,14 +36,14 @@ select new { Type = t, Attributes = attributes.Cast<ShifterCategoryAttribute>() btn.Text = type.Attributes.First().Name; btn.Click += (o, a) => { - ShowAllPropertyGridsInCategory(btn.Text); + ShowAllPropertyGridsInCategory(Activator.CreateInstance(type.Type)); }; pnlcategories.Widgets.Add(btn); btn.Show(); } } - public void ShowAllPropertyGridsInCategory(string cat) + public void ShowAllPropertyGridsInCategory(object cls) { } @@ -53,13 +53,33 @@ select new { Type = t, Attributes = attributes.Cast<ShifterCategoryAttribute>() [ShifterPropertyGrid("Desktop")] public class ShifterDesktopSettings { + [Upgrade("skinning")] [SkinMap("images/desktopbackground")] public Image DesktopBackground { get; set; } + [Upgrade("shiftdesktopbackground")] [SkinMap("skin/desktopbackgroundcolour")] public Color DesktopBackgroundColor { get; set; } } + public class UpgradeAttribute : Attribute + { + public UpgradeAttribute(string upgrade) + { + upg = upgrade; + } + + private string upg = ""; + + public bool UpgradeInstalled + { + get + { + return API.Upgrades[upg]; + } + } + } + public class SkinMapAttribute : Attribute { public SkinMapAttribute(string varName) |
