Performs the SaveAs operation. Saves a file after the running document table has been updated, creating new folders if necessary.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Protected Overrides Function AfterSaveItemAs ( _
docData As IntPtr, _
newFilePath As String _
) As Integer
'使用
Dim docData As IntPtr
Dim newFilePath As String
Dim returnValue As Integer
returnValue = Me.AfterSaveItemAs(docData, _
newFilePath)
protected override int AfterSaveItemAs(
IntPtr docData,
string newFilePath
)
protected:
virtual int AfterSaveItemAs(
IntPtr docData,
String^ newFilePath
) override
protected override function AfterSaveItemAs(
docData : IntPtr,
newFilePath : String
) : int
Parameters
docData
Type: System.IntPtrPointer to the running document table.
newFilePath
Type: System.StringThe new name and path.
Return Value
Type: System.Int32
Always returns S_OK.
Remarks
This method is called from SaveItem() after the running document table has been updated. It determines whether the directory location has changed; if necessary, it constructs and adds new directories to the project. It then calls [M:Microsoft.VisualStudio.Package.SuspendFileChanges.Suspend()], which causes the editor to ignore external changes, and calls [M:Microsoft.VisualStudio.Package.DocumentManager.UpdateCaption(System.IServiceProvider site, string caption, System.IntPtr docData)]. If the file's path or parent have changed, the current method calls [RenameFileNode(string oldFileName, string newFileName, uint newParentId)], which deletes the old file node and creates a new one. Finally it calls [M:Microsoft.VisualStudio.Package.SuspendFileChanges.Resume()], which returns the editor to its previous state.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.