IVsSccOpenFromSourceControl::AddItemFromSourceControl Method (IVsProject^, UInt32, UInt32, array<String^>^, IntPtr, UInt32, Guid, String^, Guid, array<VSADDRESULT>^)

 

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

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

int AddItemFromSourceControl(
	IVsProject^ pProject,
	unsigned int itemidLoc,
	unsigned int cFilesToAdd,
	array<String^>^ rgpszFilesToAdd,
	IntPtr hwndDlgOwner,
	unsigned int grfEditorFlags,
	[InAttribute] Guid% rguidEditorType,
	String^ pszPhysicalView,
	[InAttribute] Guid% rguidLogicalView,
	array<VSADDRESULT>^ pResult
)

Parameters

pProject
Type: Microsoft.VisualStudio.Shell.Interop::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
Type: System::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
Type: System::UInt32

[in] Number of files specified in rgpszFilesToAdd array.

rgpszFilesToAdd
Type: array<System::String^>^

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

hwndDlgOwner
Type: System::IntPtr

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

grfEditorFlags
Type: System::UInt32

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

rguidEditorType
Type: System::Guid

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

pszPhysicalView
Type: System::String^

[in] Name of the physical view being used.

rguidLogicalView
Type: System::Guid

[in] GUID that identifies the logical view.

pResult
Type: array<Microsoft.VisualStudio.Shell.Interop::VSADDRESULT>^

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

Return Value

Type: System::Int32

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

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.

Return to top
Show: