BrightIdeasSoftware.Utilities.ImagelistAdd.AddIconOfFile C# (CSharp) Метод

AddIconOfFile() публичный статический Метод

Extracts the icon of an existing file or folder on the system and adds the icon to an imagelist.
public static AddIconOfFile ( string fileName, IconSizeZ IconSizeZ, bool selectedState, bool openState, bool linkOverlay, ImageList destinationImagelist ) : void
fileName string A file or folder path to extract the icon from.
IconSizeZ IconSizeZ The size to extract.
selectedState bool A flag to add the selected state of the icon.
openState bool A flag to add the open state of the icon.
linkOverlay bool A flag to add a shortcut overlay to the icon.
destinationImagelist System.Windows.Forms.ImageList An existing imagelist to add the extracted icon to.
Результат void
        public static void AddIconOfFile(string fileName, IconSizeZ IconSizeZ, bool selectedState, bool openState, bool linkOverlay, ImageList destinationImagelist)
        {
            uint uFlags = ((IconSizeZ == IconSizeZ.Large) ? SHGFI_LARGEICON : 0) |
                            ((IconSizeZ == IconSizeZ.Small) ? SHGFI_SMALLICON : 0) |
                            ((IconSizeZ == IconSizeZ.Shell) ? SHGFI_SHELLICONSIZE : 0) |
                            ((selectedState) ? SHGFI_SELECTED : 0) |
                            ((openState) ? SHGFI_OPENICON : 0) |
                            ((linkOverlay) ? SHGFI_LINKOVERLAY : 0);

            Add(fileName, destinationImagelist, uFlags);
        }

Same methods

ImagelistAdd::AddIconOfFile ( string fileName, ImageList destinationImagelist ) : void