FileIcon class
Namespace: Velopack.Windows
Enables extraction of icons for any file type from the Shell.
[ExcludeFromCodeCoverage]
public class FileIcon
Constructors
| Constructor | Summary |
|---|---|
FileIcon | Constructs a new, default instance of the FileIcon |
FileIcon | Constructs a new instance of the FileIcon class |
FileIcon | Constructs 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
| Name | Type | Description |
|---|---|---|
fileName | string | The 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
| Name | Type | Description |
|---|---|---|
fileName | string | The filename to get information for |
flags | FileIcon.SHGetFileInfoConstants | The flags to use when extracting the icon and other shell information. |
Properties
| Property | Summary |
|---|---|
Flags | Gets/sets the flags used to extract the icon |
FileName | Gets/sets the filename to get the icon for |
ShellIcon | Gets the icon for the chosen file |
DisplayName | Gets the display name for the selected file |
TypeName | Gets 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