This documentation is archived and is not being maintained.

SourceControl Object

Visual Studio .NET 2003

You can use the SourceControl object to programmatically perform source control operations on the currently loaded project.

Properties

Property Description
DTE Returns the top-level extensibility object.
Parent Returns the top-level extensibility object.

Methods

Method Description
CheckOutItem Checks out the specified item.
CheckOutItems Checks out the specified items.
ExcludeItem Excludes the specified item from source control.
ExcludeItems Excludes the specified items from source control.
IsItemCheckedOut Retrieves a Boolean value that indicates whether the specified item is checked out.
IsItemUnderSCC Retrieves a Boolean value that indicates whether the specified item is under source control.

Requirements

To use the SourceControl object, you must add a project reference to the envdte assembly and must import EnvDTE assembly into your project file.

To add the envdte reference

  1. On the Project menu, click Add Reference.
  2. In the Add Reference dialog box, select the envdte component on the .NET tab, and then click Select.
  3. In the file in which you will use the SourceControl object, include the following statement.
    ' Visual Basic
    Imports EnvDTE 
    

    — or —

    ' C#
    using EnvDTE;
    

See Also

Source Control Services | Source Control Automation Reference

Show: