public TreeNodeIconSelector(string what, NamedIconSet set) : base(what) { iconSet = set; }
private void PlaceImage(bool selected, Image image, string name) { if (!name.Contains(" ")) throw new FatalErrorException("Icon " + name + " is illegal, it has to contain a space.\n" + ICON_INSTRUCTIONS); if (!selected) { NamedImage namedImage = new NamedImageUnselected(image, name); NamedIconSet namedSet = new NamedIconSet(); namedSet.ImageUnselected = namedImage; if (icons.ContainsKey(namedImage.FancyName)) { throw new FatalErrorException("Problem with icons, duplicate icon " + name + "\n" + ICON_INSTRUCTIONS); } icons.Add(namedImage.FancyName, namedSet); } else { NamedImage namedImage = new NamedImageSelected(image, name); if (!icons.ContainsKey(namedImage.FancyName)) { throw new FatalErrorException("Problem with icons, unmatched icon " + name + "\n" + ICON_INSTRUCTIONS); } NamedIconSet namedSet = icons[namedImage.FancyName]; namedSet.ImageSelected = namedImage; } }