Example #1
0
        public Icon GetStaticIcon(StaticIconType type, 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();
            }

            ShellIcon.FolderType folderType;
            switch (type)
            {
            case StaticIconType.OpenDirectory:
                folderType = ShellIcon.FolderType.Open;
                break;

            case StaticIconType.CloseDirectory:
                folderType = ShellIcon.FolderType.Closed;
                break;

            default:
                throw new NotSupportedException();
            }

            SD.Icon icon = ShellIcon.GetFolderIcon(iconSize, folderType);
            return(new Icon(Widget.Generator, new IconHandler(icon)));
        }
Example #2
0
        public Icon GetFileIcon(string fileName, Eto.IO.IconSize size)
        {
            ShellIcon.IconSize iconSize;
            switch (size)
            {
            default:
            case IconSize.Large: iconSize = ShellIcon.IconSize.Large; break;

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

            SD.Icon icon = ShellIcon.GetFileIcon(fileName, iconSize, false);
            return(new Icon(Widget.Generator, new IconHandler(icon)));
        }
Example #3
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(Widget.Generator, new IconHandler(icon)));
        }
Example #4
0
        public Icon GetStaticIcon(Eto.IO.StaticIconType type, Eto.IO.IconSize size)
        {
            ShellIcon.IconSize iconSize;
            switch (size)
            {
            default:
            case IconSize.Large: iconSize = ShellIcon.IconSize.Large; break;

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

            ShellIcon.FolderType folderType;
            switch (type)
            {
            default:
            case StaticIconType.OpenDirectory: folderType = ShellIcon.FolderType.Open;  break;

            case StaticIconType.CloseDirectory: folderType = ShellIcon.FolderType.Closed;  break;
            }

            SD.Icon icon = ShellIcon.GetFolderIcon(iconSize, folderType);
            return(new Icon(Widget.Generator, new IconHandler(icon)));
        }