public void LoadImages(bool loadCustomIcons) { ImgList.Clear(); keyFileDict.Clear(); ImgList.Add("default", defImage); foreach (KeyValuePair <string, Pixbuf> image in defaultImages) { ImgList.Add(image.Key, image.Value); } if (Directory.Exists("icons") && loadCustomIcons) { foreach (string f in Directory.GetFiles("icons")) { using (Pixbuf img = new Pixbuf(f)) { string imgKey = Path.GetFileNameWithoutExtension(f); if (ImgList.ContainsKey(imgKey)) { ImgList.Remove(imgKey); } keyFileDict[imgKey] = f; ImgList.Add(imgKey, img); } } } }
public Pixbuf this[string key] { get { if (ImgList.ContainsKey(key)) { return(ImgList[key]); } else { return(defImage); } } }