IVsSccOpenFromSourceControl.AddItemFromSourceControl Method
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)
Syntax
'宣告
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, _
<OutAttribute> pResult As VSADDRESULT() _
) As Integer
'用途
Dim instance As IVsSccOpenFromSourceControl
Dim pProject As IVsProject
Dim itemidLoc As UInteger
Dim cFilesToAdd As UInteger
Dim rgpszFilesToAdd As String()
Dim hwndDlgOwner As IntPtr
Dim grfEditorFlags As UInteger
Dim rguidEditorType As Guid
Dim pszPhysicalView As String
Dim rguidLogicalView As Guid
Dim pResult As VSADDRESULT()
Dim returnValue As Integer
returnValue = instance.AddItemFromSourceControl(pProject, _
itemidLoc, cFilesToAdd, rgpszFilesToAdd, _
hwndDlgOwner, grfEditorFlags, rguidEditorType, _
pszPhysicalView, rguidLogicalView, _
pResult)
int AddItemFromSourceControl(
IVsProject pProject,
uint itemidLoc,
uint cFilesToAdd,
string[] rgpszFilesToAdd,
IntPtr hwndDlgOwner,
uint grfEditorFlags,
ref Guid rguidEditorType,
string pszPhysicalView,
ref Guid rguidLogicalView,
VSADDRESULT[] pResult
)
int AddItemFromSourceControl(
[InAttribute] IVsProject^ pProject,
[InAttribute] unsigned int itemidLoc,
[InAttribute] unsigned int cFilesToAdd,
[InAttribute] array<String^>^ rgpszFilesToAdd,
[InAttribute] IntPtr hwndDlgOwner,
[InAttribute] unsigned int grfEditorFlags,
[InAttribute] Guid% rguidEditorType,
[InAttribute] String^ pszPhysicalView,
[InAttribute] Guid% rguidLogicalView,
[OutAttribute] array<VSADDRESULT>^ pResult
)
abstract AddItemFromSourceControl :
pProject:IVsProject *
itemidLoc:uint32 *
cFilesToAdd:uint32 *
rgpszFilesToAdd:string[] *
hwndDlgOwner:IntPtr *
grfEditorFlags:uint32 *
rguidEditorType:Guid byref *
pszPhysicalView:string *
rguidLogicalView:Guid byref *
pResult:VSADDRESULT[] byref -> int
function AddItemFromSourceControl(
pProject : IVsProject,
itemidLoc : uint,
cFilesToAdd : uint,
rgpszFilesToAdd : String[],
hwndDlgOwner : IntPtr,
grfEditorFlags : uint,
rguidEditorType : Guid,
pszPhysicalView : String,
rguidLogicalView : Guid,
pResult : VSADDRESULT[]
) : int
Parameters
pProject
Type: Microsoft.VisualStudio.Shell.Interop.IVsProject
[in] IVsProject interface for the project to add the items to.注意
T:Microsoft.VisualStudio.Shell.Interop.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.
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsSccOpenFromSourceControl Interface