Compartilhar via


LanguageService.CurFileExtensionFormat(String) Method

Definition

Returns the index into the file extension list that matches the extension of the specified file name.

public:
 virtual int CurFileExtensionFormat(System::String ^ fileName);
public:
 virtual int CurFileExtensionFormat(Platform::String ^ fileName);
 virtual int CurFileExtensionFormat(std::wstring const & fileName);
public virtual int CurFileExtensionFormat (string fileName);
abstract member CurFileExtensionFormat : string -> int
override this.CurFileExtensionFormat : string -> int
Public Overridable Function CurFileExtensionFormat (fileName As String) As Integer

Parameters

fileName
String

[in] The file name from which to get the extension to look for.

Returns

If successful, returns a zero-based index into the file extension list that is returned from GetFormatFilterList(); otherwise, returns -1 to indicate the extension is not in the file extension list.

Remarks

This is used to select the appropriate filter when showing a Save As dialog box to save a file.

The base method calls Microsoft.VisualStudio.Package.LanguageService.GetFormatFilterList and then searches the list for the extension. Note that Microsoft.VisualStudio.Package.LanguageService.GetFormatFilterList returns a single string: the extensions are separated either by newlines or vertical bars ("|") and the base method can handle either separator.

Applies to