aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Apps/IconManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'source/WindowsFormsApplication1/Apps/IconManager.cs')
-rw-r--r--source/WindowsFormsApplication1/Apps/IconManager.cs24
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);
}
}