Exemplo n.º 1
0
        public Icon GetFileIcon(string fileName, IconSize size)
        {
            ShellIcon.IconSize iconSize;
            switch (size)
            {
            case IconSize.Large:
                iconSize = ShellIcon.IconSize.Large;
                break;

            case IconSize.Small:
                iconSize = ShellIcon.IconSize.Small;
                break;

            default:
                throw new NotSupportedException();
            }

            SD.Icon icon = ShellIcon.GetFileIcon(fileName, iconSize, false);
            return(new Icon(new IconHandler(icon)));
        }