次の方法で共有


VsMSBuildTaskFileManagerClass.PutGeneratedFileContents(String, String) Method

Definition

Puts the contents for the generated file into an in-memory TextBuffer and registers it in the running document table (RDT) with an RDT_ReadLock. This holds the file open in memory until the project is closed (when the project calls IVsMSBuildHostObject::Close).

public:
 virtual int PutGeneratedFileContents(System::String ^ wszFilename, System::String ^ wszFileContents) = Microsoft::VisualStudio::Shell::Interop::IVsMSBuildTaskFileManager::PutGeneratedFileContents;
public:
 virtual int PutGeneratedFileContents(System::String ^ wszFilename, System::String ^ wszFileContents);
public:
 virtual int PutGeneratedFileContents(Platform::String ^ wszFilename, Platform::String ^ wszFileContents) = Microsoft::VisualStudio::Shell::Interop::IVsMSBuildTaskFileManager::PutGeneratedFileContents;
 virtual int PutGeneratedFileContents(std::wstring const & wszFilename, std::wstring const & wszFileContents);
public virtual int PutGeneratedFileContents (string wszFilename, string wszFileContents);
abstract member PutGeneratedFileContents : string * string -> int
override this.PutGeneratedFileContents : string * string -> int
Public Overridable Function PutGeneratedFileContents (wszFilename As String, wszFileContents As String) As Integer

Parameters

wszFilename
String

[in] The filename of the file from which to obtain generated contents.

wszFileContents
String

[out] The generated contents retrieved from the specified file.

Returns

Returns S_OK if the method is successful; otherwise, returns E_FAIL if the document is in the RDT and something else has a lock on it which cannot be removed automatically.

Implements

Remarks

If this is an actual build operation (UICONTEXT_SolutionBuilding is on), then the file contents will also be saved to disk. If this is a design-time-only generation 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.

Applies to