Udostępnij za pośrednictwem


IVsImageService.GetIconForFile(String, __VSUIDATAFORMAT) Method

Definition

Caution

Use IVsImageService2.GetImageMonikerForFile instead

Gets the 16x16 icon for the specified file.

public:
 Microsoft::VisualStudio::Shell::Interop::IVsUIObject ^ GetIconForFile(System::String ^ filename, Microsoft::VisualStudio::Shell::Interop::__VSUIDATAFORMAT desiredFormat);
public:
 Microsoft::VisualStudio::Shell::Interop::IVsUIObject ^ GetIconForFile(Platform::String ^ filename, Microsoft::VisualStudio::Shell::Interop::__VSUIDATAFORMAT desiredFormat);
Microsoft::VisualStudio::Shell::Interop::IVsUIObject GetIconForFile(std::wstring const & filename, Microsoft::VisualStudio::Shell::Interop::__VSUIDATAFORMAT desiredFormat);
public Microsoft.VisualStudio.Shell.Interop.IVsUIObject GetIconForFile (string filename, Microsoft.VisualStudio.Shell.Interop.__VSUIDATAFORMAT desiredFormat);
[System.Obsolete("Use IVsImageService2.GetImageMonikerForFile instead")]
public Microsoft.VisualStudio.Shell.Interop.IVsUIObject GetIconForFile (string filename, Microsoft.VisualStudio.Shell.Interop.__VSUIDATAFORMAT desiredFormat);
abstract member GetIconForFile : string * Microsoft.VisualStudio.Shell.Interop.__VSUIDATAFORMAT -> Microsoft.VisualStudio.Shell.Interop.IVsUIObject
[<System.Obsolete("Use IVsImageService2.GetImageMonikerForFile instead")>]
abstract member GetIconForFile : string * Microsoft.VisualStudio.Shell.Interop.__VSUIDATAFORMAT -> Microsoft.VisualStudio.Shell.Interop.IVsUIObject
Public Function GetIconForFile (filename As String, desiredFormat As __VSUIDATAFORMAT) As IVsUIObject

Parameters

filename
String

[in] The file name of the icon.

desiredFormat
__VSUIDATAFORMAT

[in] The data format used in the user interface.

Returns

The icon object. Returns null if the icon cannot be retrieved.

Attributes

Applies to