Share via


IVsQueryEditQuerySave2.DeclareReloadableFile Method

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

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

Syntax

'Declaration
Function DeclareReloadableFile ( _
    pszMkDocument As String, _
    rgf As UInteger, _
    pFileInfo As VSQEQS_FILE_ATTRIBUTE_DATA() _
) As Integer
int DeclareReloadableFile(
    string pszMkDocument,
    uint rgf,
    VSQEQS_FILE_ATTRIBUTE_DATA[] pFileInfo
)
int DeclareReloadableFile(
    [InAttribute] String^ pszMkDocument, 
    [InAttribute] unsigned int rgf, 
    [InAttribute] array<VSQEQS_FILE_ATTRIBUTE_DATA>^ pFileInfo
)
abstract DeclareReloadableFile : 
        pszMkDocument:string * 
        rgf:uint32 * 
        pFileInfo:VSQEQS_FILE_ATTRIBUTE_DATA[] -> int
function DeclareReloadableFile(
    pszMkDocument : String, 
    rgf : uint, 
    pFileInfo : VSQEQS_FILE_ATTRIBUTE_DATA[]
) : int

Parameters

  • pszMkDocument
    Type: System.String

    [in] Path to the file on the disk.

  • rgf
    Type: System.UInt32

    [in] Flags whose values for valid file attributes are taken from the tagVSQEQSFlags enumeration. The default value is zero.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

Used only in special cases.

COM Signature

From ivsqueryeditquerysave2.idl

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

The environment automatically calls this service method on behalf of a project for its root node, and for solution .sln files. It is also called in the following circumstances:

  • So the project or editor can ensure that the service knows the file is reloadable.

    -or-

  • When IsDocDataReloadable specifies it by returning true. (This is the recommended case.)

If no other information is available, then items that are passed to QueryEditFiles, QuerySaveFile, QuerySaveFiles, or OnAfterAttributeChange (RDTA_DocDataIsDirty) are considered to be reloadable only if declared so. An item is also reloadable if the doc object supports IVsPersistDocData or if the parent hierarchy supports IVsPersistHierarchyItem2. It is possible for files to transition from being reloadable to unreloadable during the lifetime of an editor.

Note

By default, a file is assumed to be not reloadable in the absence of IVsPersistDocData or IVsPersistHierarchyItem2.

.NET Framework Security

See Also

Reference

IVsQueryEditQuerySave2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace