mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-22 15:26:29 +00:00
37 lines
893 B
C#
37 lines
893 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace PckStudio.Core.Extensions
|
|
{
|
|
public static class ImageCollectionExtensions
|
|
{
|
|
public static void Insert(this ImageList.ImageCollection _, int index, string key, Image image)
|
|
{
|
|
var images = new List<Image>();
|
|
var keys = new List<string>();
|
|
|
|
for (int i = 0; i < _.Count; i++)
|
|
{
|
|
keys.Add(_.Keys[i]);
|
|
images.Add(_[i]);
|
|
}
|
|
|
|
images.Insert(index, image);
|
|
keys.Insert(index, key);
|
|
|
|
_.Clear();
|
|
|
|
for (int i = 0; i < images.Count; i++)
|
|
{
|
|
_.Add(keys[i], images[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|