IVsSccManager2.RegisterSccProject Method
This method is called by projects that are under source control when they are first opened to register project settings.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'宣言
Function RegisterSccProject ( _
pscp2Project As IVsSccProject2, _
pszSccProjectName As String, _
pszSccAuxPath As String, _
pszSccLocalPath As String, _
pszProvider As String _
) As Integer
'使用
Dim instance As IVsSccManager2
Dim pscp2Project As IVsSccProject2
Dim pszSccProjectName As String
Dim pszSccAuxPath As String
Dim pszSccLocalPath As String
Dim pszProvider As String
Dim returnValue As Integer
returnValue = instance.RegisterSccProject(pscp2Project, _
pszSccProjectName, pszSccAuxPath, _
pszSccLocalPath, pszProvider)
int RegisterSccProject(
IVsSccProject2 pscp2Project,
string pszSccProjectName,
string pszSccAuxPath,
string pszSccLocalPath,
string pszProvider
)
int RegisterSccProject(
[InAttribute] IVsSccProject2^ pscp2Project,
[InAttribute] String^ pszSccProjectName,
[InAttribute] String^ pszSccAuxPath,
[InAttribute] String^ pszSccLocalPath,
[InAttribute] String^ pszProvider
)
function RegisterSccProject(
pscp2Project : IVsSccProject2,
pszSccProjectName : String,
pszSccAuxPath : String,
pszSccLocalPath : String,
pszProvider : String
) : int
Parameters
pscp2Project
Type: Microsoft.VisualStudio.Shell.Interop.IVsSccProject2[in] Pointer to the project's IVsSccProject2 interface. This interface must be on the same object that supports IVsProject3 and IVsHierarchy.
pszSccProjectName
Type: System.String[in] A string that identifies the project location on the server.
pszSccAuxPath
Type: System.String[in] A string that identifies the path to the server.
pszSccLocalPath
Type: System.String[in] A string that identifies the local path to the project.
pszProvider
Type: System.String[in] A string that identifies the source control package.
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 ivssccmanager2.idl
HRESULT RegisterSccProject(
[in] IVsSccProject2 *pscp2Project,
[in] LPCOLESTR pszSccProjectName,
[in] LPCOLESTR pszSccAuxPath,
[in] LPCOLESTR pszSccLocalPath,
[in] LPCOLESTR pszProvider
);
Project implementers: you can determine whether your project is under source control by checking if the source control strings provided in the pszSccProjectName, pszSccAuxPath, pszSccLocalPath, and pszProvider parameters are persisted in your project. If these strings are not present (or are blank or null), do not call this method. If these strings are present, then they were provided to the project through SetSccLocation before the project was last closed. When the project is next opened, pass these strings back to the Source Control Stub (the part of Visual Studio that manages source control packages) using its implementation of RegisterSccProject. The Source Control Stub will load the appropriate source control package and forward the strings by calling that package's implementation of this method.
Note Projects treat the strings as opaque and do not attempt to parse them. Projects look at the strings only to determine if they are empty or not.
Permissions
- 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.