IVsMSBuildTaskFileManager.PutGeneratedFileContents Method

Puts the contents of a generated file into an in-memory buffer and registers it in the RDT.

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

Syntax

‘선언
Function PutGeneratedFileContents ( _
    wszFilename As String, _
    wszFileContents As String _
) As Integer
‘사용 방법
Dim instance As IVsMSBuildTaskFileManager
Dim wszFilename As String
Dim wszFileContents As String
Dim returnValue As Integer

returnValue = instance.PutGeneratedFileContents(wszFilename, _
    wszFileContents)
int PutGeneratedFileContents(
    string wszFilename,
    string wszFileContents
)
int PutGeneratedFileContents(
    [InAttribute] String^ wszFilename, 
    [InAttribute] String^ wszFileContents
)
abstract PutGeneratedFileContents : 
        wszFilename:string * 
        wszFileContents:string -> int 
function PutGeneratedFileContents(
    wszFilename : String, 
    wszFileContents : String
) : int

Parameters

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Returns E_FAIL if the document is in the RDT and something else has a lock on it which cannot be removed automatically.

Remarks

This method puts the contents for the generated file into an in memory TextBuffer and registers it in the RDT with a RDT_ReadLock. This holds the file open in memory until the project is closed (when the project will call Close). If this is an actual build operation (such as if UICONTEXT_SolutionBuilding is on) then the file will also be saved to disk. If the generation is at design time for Intellisense purposes then the file contents are only put into memory and the disk is not modified. The in-memory TextBuffer is always marked as clean so the user will not be prompted to save the generated file.

COM Signature

From vsshell90.idl:

HRESULT PutGeneratedFileContents(
    [in] LPCOLESTR wszFilename,
    [in] LPCOLESTR wszFileContents
);

.NET Framework Security

See Also

Reference

IVsMSBuildTaskFileManager Interface

IVsMSBuildTaskFileManager Members

Microsoft.VisualStudio.Shell.Interop Namespace