Compartir a través de


IVsSccProjectProviderBinding Interface

Allows a project type to force the choice of a particular source control package.

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

Syntax

'Declaration
<GuidAttribute("53544C4D-02F8-11D0-8E5E-00A0C911005A")> _
<InterfaceTypeAttribute()> _
Public Interface IVsSccProjectProviderBinding
[GuidAttribute("53544C4D-02F8-11D0-8E5E-00A0C911005A")]
[InterfaceTypeAttribute()]
public interface IVsSccProjectProviderBinding
[GuidAttribute(L"53544C4D-02F8-11D0-8E5E-00A0C911005A")]
[InterfaceTypeAttribute()]
public interface class IVsSccProjectProviderBinding
[<GuidAttribute("53544C4D-02F8-11D0-8E5E-00A0C911005A")>]
[<InterfaceTypeAttribute()>]
type IVsSccProjectProviderBinding =  interface end
public interface IVsSccProjectProviderBinding

The IVsSccProjectProviderBinding type exposes the following members.

Methods

  Name Description
Public method BrowseServerPath Displays a browse dialog box so that the user can browse for a source control server location.
Public method GetProviderBinding Determines if this project requires a specific source control package or if the project should be put under source control.
Public method GetProviderBindingOptions Retrieves the flags that control editing of the source control server path.
Public method GetProviderService This method retrieves the service ID (SID) of a service object that will be used to instantiate a source control package.
Public method GetProviderSession Returns a session object for a Version API (VAPI)-style source control package.
Public method TranslateEnlistmentPath Translates an enlistment path into a displayable path.
Public method ValidateServerPathEdit Determines if the given source control server path is valid.

Top

Remarks

Binding Process

What follows is the flow of control for various scenarios showing the interaction between the environment (otherwise known as the Source Control Stub) and this interface.

Adding a Project or Solution to Source Control

  1. The Source Control Stub uses QueryInterface to get the IVsSccProjectProviderBinding from the project.

    If the interface cannot be obtained, then it uses the default source control package.

  2. The Source Control Stub calls the GetProviderBinding method.

    If the result of the call is VSSCC_PB_STANDARD, then it uses the default source control package.

    -OR-

    If the result of the call is VSSCC_PB_CUSTOM_DISABLED, then the project is not added to source control.

    -OR-

    If the result of the call is VSSCC_PB_STANDARD_DISABLED, then the project is not added to source control at this time (the "Add to Source Control" button should have been disabled).

  3. The Source Control Stub calls the GetProviderBindingOptions method to see if the project supports browsing for a source control server.

    If the result of the call includes the flag VSSCC_PBO_CANBROWSESERVERPATH, then the Source Control Stub calls the BrowseServerPath method.

    Otherwise, the Source Control Stub calls the GetProviderSession method to get a provider session and displays a standard Version API (VAPI) browse the dialog box using that session.

  4. The Source Control Stub calls the GetProviderService method and stores the returned service GUID (SID) in the project's configuration.

  5. The Source Control Stub calls the SetSccLocation method with the selected server location.

  6. The Source Control Stub calls GetProviderSession to get the actual provider and initiates the Add to Source Control operation.

Opening a Project or Solution from Source Control

Because the Source Control Stub gets the project from source control, the source control package must exist at least in stub form before the project is read.

  1. The Source Control Stub reads the solution from source control.

  2. The Source Control Stub obtains the project information from the solution and looks for the source control package service GUID in the project's configuration.

    If the project does not contain a source control package service GUID, then the Source Control Stub uses the regular enlistment process.

  3. The Source Control Stub uses the SID to create a source control package session.

  4. The Source Control Stub uses this provider session to create an enlistment in the project.

Note

Although this may be a project-specific source control package, the project does not yet exist.

  1. Once the enlistment is completed, control returns to the solution.

  2. The Source Control Stub reads the project file from the solution and executes it.

  3. The project calls the RegisterSccProject method using the same information passed to the SetSccLocation method when the project was added to source control.

  4. The Source Control Stub uses QueryInterface on the new project to get the IVsSccProjectProviderBinding.

  5. If the interface is obtained, the Source Control Stub calls the GetProviderSession method (using the just obtained interface) to get a proper source control package session for this project, replacing the "stub" version being used up until now.

  6. The Source Control Stub retrieves the project's files from source control using the source control package session.

Opening an Existing Project

The project exists on the local drive at this point.

  1. Once loaded, the project calls the RegisterSccProject method with the same information passed to the SetSccLocation method when the project was added to source control.

  2. The Source Control Stub uses QueryInterface on the new project to get the IVsSccProjectProviderBinding.

  3. If the interface is obtained, the Source Control Stub calls the GetProviderSession method to get the source control package session for the project.

Changing the Connection to the Source Control Server

  1. Assuming it can get the IVsSccProjectProviderBinding interface, the Source Control Stub calls the GetProviderBindingOptions method to determine how to browse for a server location and then uses the ValidateServerPathEdit method to verify any user changes to the server path.

Notes to Implementers

This interface is implemented by a project type in order to specify a particular source control package. Unless a project type has need of a specific source control package, then there is no need to implement this interface.

Notes to Callers

This interface is called by the environment when access to a source control package is needed. If the interface does not exist or if a call to GetProviderBinding specifies otherwise, the environment uses whatever source control package is currently available.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace