예제 #1
0
파일: IconCache.cs 프로젝트: pulb/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;
        }