Ejemplo n.º 1
0
        public static Image GetShell32Icon(Shell32Icon type, bool largeIcon)
        {
            Image img = null;

            switch (type)
            {
            case Shell32Icon.DvdDisk:
                img = Resources.DVD;
                break;

            case Shell32Icon.CompactDisk:
            case Shell32Icon.DriveCdrom:
                img = Resources.CDA;
                break;

            case Shell32Icon.Internet:
            case Shell32Icon.URL:
                img = Resources.Internet;
                break;

            case Shell32Icon.GenericFolder:
                img = Resources.Folder;
                break;

            case Shell32Icon.DriveFixed:
                img = Resources.DiskDrive;
                break;

            default:
                break;
            }

            if (img != null)
            {
                return(img.Resize(largeIcon));
            }

            // Use icons provided by Shell32.dll itself
            return(GetIcon(Environment.SystemDirectory + PathUtils.DirectorySeparator + "shell32.dll",
                           (int)type, largeIcon));
        }
Ejemplo n.º 2
0
 private void LoadShell32Image(Shell32Icon shell32Icon)
 {
     ilItems.Images.Add(ImageProvider.GetShell32Icon(shell32Icon, false));
 }
Ejemplo n.º 3
0
 private void LoadShell32Image(Shell32Icon shell32Icon)
 {
     ilItems.Images.Add(ImageProvider.GetShell32Icon(shell32Icon, false));
 }
Ejemplo n.º 4
0
        public static Image GetShell32Icon(Shell32Icon type, bool largeIcon)
        {
            switch (type)
            {
                case Shell32Icon.DvdDisk:
                    return Resources.DVD;

                case Shell32Icon.CompactDisk:
                    return Resources.CDA;

                case Shell32Icon.Internet:
                    return Resources.Internet;

                default:
                    break;

            }


            // Use icons provided by Shell32.dll itself
            return GetIcon(Environment.SystemDirectory + PathUtils.DirectorySeparator + "shell32.dll",
                (int)type, largeIcon);
        }