共用方式為


IVsQueryEditQuerySave2.DeclareUnreloadableFile Method

States that a file will not be reloaded if it changes on disk

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'宣告
Function DeclareUnreloadableFile ( _
    pszMkDocument As String, _
    rgf As UInteger, _
    pFileInfo As VSQEQS_FILE_ATTRIBUTE_DATA() _
) As Integer
'用途
Dim instance As IVsQueryEditQuerySave2
Dim pszMkDocument As String
Dim rgf As UInteger
Dim pFileInfo As VSQEQS_FILE_ATTRIBUTE_DATA()
Dim returnValue As Integer

returnValue = instance.DeclareUnreloadableFile(pszMkDocument, _
    rgf, pFileInfo)
int DeclareUnreloadableFile(
    string pszMkDocument,
    uint rgf,
    VSQEQS_FILE_ATTRIBUTE_DATA[] pFileInfo
)
int DeclareUnreloadableFile(
    [InAttribute] String^ pszMkDocument, 
    [InAttribute] unsigned int rgf, 
    [InAttribute] array<VSQEQS_FILE_ATTRIBUTE_DATA>^ pFileInfo
)
function DeclareUnreloadableFile(
    pszMkDocument : String, 
    rgf : uint, 
    pFileInfo : VSQEQS_FILE_ATTRIBUTE_DATA[]
) : int

Parameters

  • pszMkDocument
    Type: System.String

    [in] Path to the file on the disk.

Return Value

Type: System.Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From ivsqueryeditquerysave2.idl

HRESULT DeclareUnreloadableFile(
   [in] LPCOLESTR pszMkDocument,
   [in] VSQEQSFlags rgf,
   [in] const VSQEQS_FILE_ATTRIBUTE_DATA* pFileInfo
);

Use of this method is not recommended. Editors should support reload.

This method is called to ensure that the QueryEditFiles, QuerySaveFile, and QuerySaveFiles methods know that a file is not reloadable. It must be called in the following circumstances:

  • So the project, solution, or editor can ensure that the service knows the file is not reloadable,

    -or-

  • When IsDocDataReloadable specifies that the file is not reloadable by returning false.

If the unreloadable file is being edited, you cannot get the latest version of it. It is possible for files to transition from being reloadable to unreloadable during the lifetime of an editor.

Permissions

See Also

Reference

IVsQueryEditQuerySave2 Interface

IVsQueryEditQuerySave2 Members

Microsoft.VisualStudio.Shell.Interop Namespace