次の方法で共有


IVsQueryEditQuerySave2 Interface

Definition

Indicates to the environment or source control package that a file is about to be changed in memory or saved.

public interface class IVsQueryEditQuerySave2
public interface class IVsQueryEditQuerySave2
__interface IVsQueryEditQuerySave2
[System.Runtime.InteropServices.Guid("53544C4D-5984-11D3-A606-005004775AB1")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsQueryEditQuerySave2
[System.Runtime.InteropServices.Guid("53544C4D-5984-11D3-A606-005004775AB1")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsQueryEditQuerySave2
[<System.Runtime.InteropServices.Guid("53544C4D-5984-11D3-A606-005004775AB1")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsQueryEditQuerySave2 = interface
[<System.Runtime.InteropServices.Guid("53544C4D-5984-11D3-A606-005004775AB1")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsQueryEditQuerySave2 = interface
Public Interface IVsQueryEditQuerySave2
Attributes

Remarks

IVsQueryEditQuerySave2 is implemented by Visual Studio and the individual source control packages in the SVsQueryEditQuerySave service, and is called by editor and project packages. This interface allows the environment to ensure that the file is made writable or checked out at the correct time. A project or editor must request permission to transition to the changed (dirty) state by calling QueryEditFiles method. Before an editor saves a file, it must call QuerySaveFile or QuerySaveFiles. For project files, these calls are automatically completed by the solution, which knows when to save a project file. Editors are responsible for making these calls unless the editor implementation of the IVsPersistDocData2 interface uses the helper function SaveDocDataToFile method. If your editor implements the IVsPersistDocData2 interface in this way, then the call to QuerySaveFile or QuerySaveFiles is made for you.

Calls to QuerySaveFiles can be batched using the BeginQuerySaveBatch and EndQuerySaveBatch methods.

The DeclareReloadableFile and DeclareUnreloadableFile methods inform the environment whether the editor is capable of reloading the particular file. These methods are not required if the editor supports IVsPersistDocData or IVsPersistDocData2.

OnAfterSaveUnreloadableFile method is called by the environment for nonreloadable files.

Notes to Implementers

This interface is implemented by the source control package. It is recommended that this interface be implemented. The environment always implements this interface and forwards all calls, if possible, to the current source control package. If this interface is not implemented, the user may need to manually check out the files from source control and reload them in the IDE.

Notes to Callers

The methods of the IVsQueryEditQuerySave2 interface should be called immediately before a document is edited for the first time, and immediately before a document is saved.

Methods

BeginQuerySaveBatch()

Creates a batch of a sequence of documents before attempting to save them to disk.

DeclareReloadableFile(String, UInt32, VSQEQS_FILE_ATTRIBUTE_DATA[])

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

DeclareUnreloadableFile(String, UInt32, VSQEQS_FILE_ATTRIBUTE_DATA[])

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

EndQuerySaveBatch()

Ends the batch started by the BeginQuerySaveBatch() method and displays any user interface (UI) generated within the batch.

IsReloadable(String, Int32)

Returns the SVsQueryEditQuerySave service's understanding of whether this file is reloadable

OnAfterSaveUnreloadableFile(String, UInt32, VSQEQS_FILE_ATTRIBUTE_DATA[])

Synchronizes or refreshes the file date and size after an editor saves an unreloadable file.

QueryEditFiles(UInt32, Int32, String[], UInt32[], VSQEQS_FILE_ATTRIBUTE_DATA[], UInt32, UInt32)

Called when a file is about to be edited.

QuerySaveFile(String, UInt32, VSQEQS_FILE_ATTRIBUTE_DATA[], UInt32)

Notifies the environment that a file is about to be saved.

QuerySaveFiles(UInt32, Int32, String[], UInt32[], VSQEQS_FILE_ATTRIBUTE_DATA[], UInt32)

Notifies the environment that multiple files are about to be saved.

Applies to