Saltar al contenido principal

FileIcon class

Namespace: Velopack.Windows

Enables extraction of icons for any file type from the Shell.

[ExcludeFromCodeCoverage]
public class FileIcon

Constructors

ConstructorSummary
FileIconConstructs a new, default instance of the FileIcon
FileIconConstructs a new instance of the FileIcon class
FileIconConstructs a new instance of the FileIcon class

FileIcon()

public FileIcon()

Constructs a new, default instance of the FileIcon class. Specify the filename and call GetInfo() to retrieve an icon.

FileIcon(fileName)

public FileIcon(string fileName)

Constructs a new instance of the FileIcon class and retrieves the icon, display name and type name for the specified file.

Parameters

NameTypeDescription
fileNamestringThe filename to get the icon,
display name and type name for

FileIcon(fileName, flags)

public FileIcon(string fileName, FileIcon.SHGetFileInfoConstants flags)

Constructs a new instance of the FileIcon class and retrieves the information specified in the flags.

Parameters

NameTypeDescription
fileNamestringThe filename to get information
for
flagsFileIcon.SHGetFileInfoConstantsThe flags to use when extracting the
icon and other shell information.

Properties

PropertySummary
FlagsGets/sets the flags used to extract the icon
FileNameGets/sets the filename to get the icon for
ShellIconGets the icon for the chosen file
DisplayNameGets the display name for the selected file
TypeNameGets the type name for the selected file

Flags

public FileIcon.SHGetFileInfoConstants Flags { get; set; }

Gets/sets the flags used to extract the icon

FileName

public string FileName { get; set; }

Gets/sets the filename to get the icon for

ShellIcon

public nint ShellIcon { get; }

Gets the icon for the chosen file

DisplayName

public string DisplayName { get; }

Gets the display name for the selected file if the SHGFI_DISPLAYNAME flag was set.

TypeName

public string TypeName { get; }

Gets the type name for the selected file if the SHGFI_TYPENAME flag was set.


Generated from Velopack 1.1.1