private void btnsave_Click(object sender, EventArgs e) { foreach (Control ctrl in pnlicons.Controls) { try { IconControl ic = (IconControl)ctrl; Skinning.Utilities.IconRegistry[ic.IconName] = ic.LargeImage; } catch (Exception ex) { IconControl ic = (IconControl)ctrl; Skinning.Utilities.IconRegistry.Add(ic.IconName, ic.LargeImage); } } var rnd = new Random(); int cp = rnd.Next(0, 10); Skinning.Utilities.saveimages(); API.AddCodepoints(cp); if (API.CurrentSession != null) { API.CurrentSession.SetupAppLauncher(); API.CurrentSession.SetupDesktopIcons(); } GetAllIcons(); API.CreateInfoboxSession("Icon pack set.", $"Your icon pack has been set successfully. You have earned {cp} Codepoints.", infobox.InfoboxMode.Info); }
public void GetAllIcons() { pnlicons.Controls.Clear(); pnlicons.Margin = new Padding(0); foreach (var kv in API.IconRegistry) { var ctrl = new IconControl(); ctrl.Margin = new Padding(0); ctrl.IconName = kv.Key; ctrl.LargeImage = kv.Value; pnlicons.Controls.Add(ctrl); ctrl.Show(); } }