Пример #1
0
        public static int GetImageIndexByExtention(string ext)
        {
            GetSharedInstance();

            ext = ext.ToLower();

            if (!m_ImageList.Images.ContainsKey(ext))
            {
                Icon iconForFile = IconReader.GetFileIconByExt(ext, IconReader.EnumIconSize.Small, false);

                m_ImageList.Images.Add(ext, iconForFile);
            }

            return(m_ImageList.Images.IndexOfKey(ext));
        }
Пример #2
0
        public static int GetImageIndexFromFolder(bool open)
        {
            string key;

            GetSharedInstance();

            key = open ? OPEN_FOLDER_KEY : CLOSE_FOLDER_KEY;

            if (!m_ImageList.Images.ContainsKey(key))
            {
                Icon iconForFile = IconReader.GetFolderIcon(IconReader.EnumIconSize.Small, (open ? IconReader.EnumFolderType.Open : IconReader.EnumFolderType.Closed));

                m_ImageList.Images.Add(key, iconForFile);
            }

            return(m_ImageList.Images.IndexOfKey(key));
        }