private static Icon GetIcon_Interal(IconSet pIconSet, string pCustomIconPath, string pState)
{
string iconSetName = pIconSet.ToString().ToLower();
if (!string.IsNullOrEmpty(pCustomIconPath) && File.Exists(pCustomIconPath)) {
if (iconSetName.StartsWith("inv_")) {
iconSetName = "inv_overlay";
}
else {
iconSetName = "overlay";
}
Icon icon = new Icon(pCustomIconPath);
string overlayIconPath = "AEMManager.resources." + iconSetName + "." + pState + ".ico";
Icon overlayIcon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(overlayIconPath));
return GetIcon_InternalWithOverlay(icon, overlayIcon);
}
else if (iconSetName != IconSet.DEFAULT.ToString().ToLower()) {
string iconPath = "AEMManager.resources." + IconSet.DEFAULT.ToString().ToLower() + "." + pState + ".ico";
Icon icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(iconPath));
string overlayIconPath = "AEMManager.resources.iconset_" + iconSetName.Substring(0, iconSetName.Length - 1) + "." + iconSetName.Substring(iconSetName.Length - 1) + ".ico";
Icon overlayIcon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(overlayIconPath));
return GetIcon_InternalWithOverlay(icon, overlayIcon);
}
else {
string iconPath = "AEMManager.resources." + iconSetName + "." + pState + ".ico";
return new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(iconPath));
}
}