LanguageService.CurFileExtensionFormat Method

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

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'Declaration
Public Overridable Function CurFileExtensionFormat ( _
    fileName As String _
) As Integer
public virtual int CurFileExtensionFormat(
    string fileName
)
public:
virtual int CurFileExtensionFormat(
    String^ fileName
)
abstract CurFileExtensionFormat : 
        fileName:string -> int  
override CurFileExtensionFormat : 
        fileName:string -> int
public function CurFileExtensionFormat(
    fileName : String
) : int

Parameters

  • fileName
    Type: String

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

Return Value

Type: Int32
If successful, returns a zero-based index into the file extension list that is returned from LanguageService.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 LanguageService.GetFormatFilterList and then searches the list for the extension. Note that LanguageService.GetFormatFilterList returns a single string: the extensions are separated either by newlines or vertical bars ("|") and the base method can handle either separator.

.NET Framework Security

See Also

Reference

LanguageService Class

Microsoft.VisualStudio.Package Namespace