diff options
| author | Michael VanOverbeek <[email protected]> | 2016-07-25 12:57:52 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-07-25 12:57:52 -0400 |
| commit | 46c1c31302f111a1f3ec23a70e6f3986a9aa2a27 (patch) | |
| tree | f00af7ea3f6ad2641fb26fa1d310fd8b7179b39c /source/WindowsFormsApplication1/Apps/IconManager.cs | |
| parent | af48e774189596b8d7a058c564a7d6d75205ca03 (diff) | |
| parent | 6fa16209519896de09949a27425dff00ebf2970a (diff) | |
| download | shiftos-c--46c1c31302f111a1f3ec23a70e6f3986a9aa2a27.tar.gz shiftos-c--46c1c31302f111a1f3ec23a70e6f3986a9aa2a27.tar.bz2 shiftos-c--46c1c31302f111a1f3ec23a70e6f3986a9aa2a27.zip | |
Merge pull request #17 from MichaelTheShifter/shiftui_integration
Shiftui integration
Diffstat (limited to 'source/WindowsFormsApplication1/Apps/IconManager.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Apps/IconManager.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/source/WindowsFormsApplication1/Apps/IconManager.cs b/source/WindowsFormsApplication1/Apps/IconManager.cs index 2ffa24a..a2969f5 100644 --- a/source/WindowsFormsApplication1/Apps/IconManager.cs +++ b/source/WindowsFormsApplication1/Apps/IconManager.cs @@ -8,7 +8,7 @@ using System.IO.Compression; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Windows.Forms; +using ShiftUI; namespace ShiftOS { @@ -16,7 +16,15 @@ namespace ShiftOS { public IconManager() { - InitializeComponent(); + try + { + InitializeComponent(); + } + catch (Exception ex) + { + API.Crash(ex); + Close(); + } } private void IconManager_Load(object sender, EventArgs e) @@ -26,31 +34,31 @@ namespace ShiftOS public void GetAllIcons() { - pnlicons.Controls.Clear(); + pnlicons.Widgets.Clear(); pnlicons.Margin = new Padding(0); foreach(var kv in API.IconRegistry) { - var ctrl = new IconControl(); + var ctrl = new IconWidget(); ctrl.Margin = new Padding(0); ctrl.IconName = kv.Key; ctrl.LargeImage = kv.Value; - pnlicons.Controls.Add(ctrl); + pnlicons.Widgets.Add(ctrl); ctrl.Show(); } } private void btnsave_Click(object sender, EventArgs e) { - foreach (Control ctrl in pnlicons.Controls) + foreach (Widget ctrl in pnlicons.Widgets) { try { - IconControl ic = (IconControl)ctrl; + IconWidget ic = (IconWidget)ctrl; Skinning.Utilities.IconRegistry[ic.IconName] = ic.LargeImage; } catch { - IconControl ic = (IconControl)ctrl; + IconWidget ic = (IconWidget)ctrl; Skinning.Utilities.IconRegistry.Add(ic.IconName, ic.LargeImage); } } |
