Sdílet prostřednictvím


IVsSolution.SaveSolutionElement(UInt32, IVsHierarchy, UInt32) Method

Definition

Programmatically saves a document, a project, or the entire solution.

public:
 int SaveSolutionElement(System::UInt32 grfSaveOpts, Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHier, System::UInt32 docCookie);
public:
 int SaveSolutionElement(unsigned int grfSaveOpts, Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHier, unsigned int docCookie);
int SaveSolutionElement(unsigned int grfSaveOpts, Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & pHier, unsigned int docCookie);
public int SaveSolutionElement (uint grfSaveOpts, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pHier, uint docCookie);
abstract member SaveSolutionElement : uint32 * Microsoft.VisualStudio.Shell.Interop.IVsHierarchy * uint32 -> int
Public Function SaveSolutionElement (grfSaveOpts As UInteger, pHier As IVsHierarchy, docCookie As UInteger) As Integer

Parameters

grfSaveOpts
UInt32

[in] Save Options. For a list of grfSaveOpts, see __VSSLNSAVEOPTIONS.

pHier
IVsHierarchy

[in] Pointer to the IVsHierarchy interface of the document to save.

docCookie
UInt32

[in] Abstract handle to the element that was saved.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSolution::SaveSolutionElement(  
   [in] VSSLNSAVEOPTIONS grfSaveOpts,  
   [in] IVsHierarchy *pHier,  
   [in] VSCOOKIE docCookie  
);  

To save the entire solution, call SaveSolutionElement(grfSaveOpts, null, null). To save a single project, call SaveSolutionElement(grfSaveOpts, phier, null). To save a single document, call SaveSolutionElement(grfSaveOpts, null, docCookie).

Applies to