Udostępnij za pośrednictwem


IVsSccOpenFromSourceControl.AddItemFromSourceControl Method

Definition

Adds the specified item or items to the specified project directly from source control.

public:
 int AddItemFromSourceControl(Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, System::UInt32 itemidLoc, System::UInt32 cFilesToAdd, cli::array <System::String ^> ^ rgpszFilesToAdd, IntPtr hwndDlgOwner, System::UInt32 grfEditorFlags, Guid % rguidEditorType, System::String ^ pszPhysicalView, Guid % rguidLogicalView, cli::array <Microsoft::VisualStudio::Shell::Interop::VSADDRESULT> ^ pResult);
public int AddItemFromSourceControl (Microsoft.VisualStudio.Shell.Interop.IVsProject pProject, uint itemidLoc, uint cFilesToAdd, string[] rgpszFilesToAdd, IntPtr hwndDlgOwner, uint grfEditorFlags, ref Guid rguidEditorType, string pszPhysicalView, ref Guid rguidLogicalView, Microsoft.VisualStudio.Shell.Interop.VSADDRESULT[] pResult);
abstract member AddItemFromSourceControl : Microsoft.VisualStudio.Shell.Interop.IVsProject * uint32 * uint32 * string[] * nativeint * uint32 * Guid * string * Guid * Microsoft.VisualStudio.Shell.Interop.VSADDRESULT[] -> int
Public Function AddItemFromSourceControl (pProject As IVsProject, itemidLoc As UInteger, cFilesToAdd As UInteger, rgpszFilesToAdd As String(), hwndDlgOwner As IntPtr, grfEditorFlags As UInteger, ByRef rguidEditorType As Guid, pszPhysicalView As String, ByRef rguidLogicalView As Guid, pResult As VSADDRESULT()) As Integer

Parameters

pProject
IVsProject

[in] IVsProject interface for the project to add the items to. Note    IVsProject is an old interface that is not used directly. Instead, query the IVsProject3 interface for the IVsProject interface and pass that in.

itemidLoc
UInt32

[in] A value indicating where in the project hierarchy to add the items. This is a unique identifier for a project or folder item or one of the following values: VSITEMID_NIL, VSITEMID_ROOT, or VSITEMID_SELECTION.

cFilesToAdd
UInt32

[in] Number of files specified in rgpszFilesToAdd array.

rgpszFilesToAdd
String[]

[in] Array of files names to add to the project from source control.

hwndDlgOwner
IntPtr

nativeint

[in] Handle to the parent of the dialog box that will be used.

grfEditorFlags
UInt32

[in] A combination of flags from the __VSSPECIFICEDITORFLAGS enumeration.

rguidEditorType
Guid

[in] GUID that specifies the type of editor being used.

pszPhysicalView
String

[in] Name of the physical view being used.

rguidLogicalView
Guid

[in] GUID that identifies the logical view.

pResult
VSADDRESULT[]

[out] Returns a VSADDRESULT code indicating the overall status of the add process.

Returns

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

Remarks

COM Signature

From ivssccopenfromsourcecontrol.idl

HRESULT AddItemFromSourceControl(  
   [in] IVsProject *pProject,  
   [in] VSITEMID itemidLoc,  
   [in] ULONG cFilesToAdd,  
   [in, size_is(cFilesToAdd)] LPCOLESTR rgpszFilesToAdd[],  
   [in] HWND hwndDlgOwner,  
   [in] VSSPECIFICEDITORFLAGS grfEditorFlags,  
   [in] REFGUID rguidEditorType,  
   [in] LPCOLESTR pszPhysicalView,  
   [in] REFGUID rguidLogicalView,  
   [out, retval] VSADDRESULT *pResult  
);  

The implementation of this method should pass most of these parameters on to the AddItemWithSpecific method after doing whatever is necessary to pull the specified files from source control.

Applies to