[This is preliminary documentation and is subject to change.]

Gets icon for given file or folder (including drive and UNC share or server)

Namespace: Tools.IOt
Assembly: Tools.Win (in Tools.Win.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public static Icon GetIcon(
	this IPathProvider PathP,
	bool Large,
	bool Overlays
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function GetIcon ( _
	PathP As IPathProvider, _
	Large As Boolean, _
	Overlays As Boolean _
) As Icon
Visual C++
[ExtensionAttribute]
public:
static Icon^ GetIcon(
	IPathProvider^ PathP, 
	bool Large, 
	bool Overlays
)
F#
static member GetIcon : 
        PathP:IPathProvider * 
        Large:bool * 
        Overlays:bool -> Icon 
JScript
public static function GetIcon(
	PathP : IPathProvider, 
	Large : boolean, 
	Overlays : boolean
) : Icon

Parameters

PathP
Type: Tools.IOt..::..IPathProvider
Provides path to get icon for
Large
Type: System..::..Boolean
True to get large icon (false to get small icon)
Overlays
Type: System..::..Boolean
True to add all applicable overlay icons

Return Value

Icon that represents given file or folder in operating system. Null if icon obtainment failed.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IPathProvider. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

Exceptions

ExceptionCondition
System.IO..::..FileNotFoundExceptionFile or folder Path does not exists.
System..::..ArgumentNullExceptionPath is null

See Also

Collapse/expand Version History

1.5.2

  • Can get icon for empty removable drive (like CD-ROM without CD in it) and for UNC computer in format \\servername)