예제 #1
0
파일: IconCache.cs 프로젝트: balihb/basenji
        public Pixbuf GetIcon(Icons.Icon icon, IconSize size)
        {
            Pixbuf pb;
            string iconKey = icon.Name + (int)size;

            if (iconCache.TryGetValue(iconKey, out pb))
            {
                return(pb);
            }

            pb = icon.Render(widget, size);
            if (pb == null)
            {
                return(null);
            }

            iconCache.Add(iconKey, pb);
            //Debug.WriteLine(string.Format("IconCache: cached icon \"{0}\" (size = {1})", icon.Name, IconUtils.GetIconSizeVal(size)));

            return(pb);
        }
예제 #2
0
 private CategoryInfo _ci(Icons.Icon icon, string caption)
 {
     return(new CategoryInfo(RenderIcon(icon, ICON_SIZE), caption));
 }