次の方法で共有


IVsQueryEditQuerySave2.DeclareUnreloadableFile Method

Definition

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

public:
 int DeclareUnreloadableFile(System::String ^ pszMkDocument, System::UInt32 rgf, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQEQS_FILE_ATTRIBUTE_DATA> ^ pFileInfo);
int DeclareUnreloadableFile(std::wstring const & pszMkDocument, unsigned int rgf, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQEQS_FILE_ATTRIBUTE_DATA> const & pFileInfo);
public int DeclareUnreloadableFile (string pszMkDocument, uint rgf, Microsoft.VisualStudio.Shell.Interop.VSQEQS_FILE_ATTRIBUTE_DATA[] pFileInfo);
abstract member DeclareUnreloadableFile : string * uint32 * Microsoft.VisualStudio.Shell.Interop.VSQEQS_FILE_ATTRIBUTE_DATA[] -> int
Public Function DeclareUnreloadableFile (pszMkDocument As String, rgf As UInteger, pFileInfo As VSQEQS_FILE_ATTRIBUTE_DATA()) As Integer

Parameters

pszMkDocument
String

[in] Path to the file on the disk.

rgf
UInt32

[in] Flags whose values for the file attributes are taken from the tagVSQEQSFlags enumeration. Default = 0.

pFileInfo
VSQEQS_FILE_ATTRIBUTE_DATA[]

[in] Can be NULL. This parameter is ignored if rgf is 0. Values are taken from the VSQEQS_FILE_ATTRIBUTE_DATA structure.

Returns

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.

Applies to