DTE2 DTE2 DTE2 DTE2 DTE2 DTE2 Interface

Definition

The top-level object in the Visual Studio automation object model.

public interface class DTE2 : EnvDTE::_DTE
public interface class DTE2 : EnvDTE::_DTE
__interface DTE2 : EnvDTE::_DTE
[System.Runtime.InteropServices.Guid("2EE1E9FA-0AFE-4348-A89F-ED9CB45C99CF")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface DTE2 : EnvDTE._DTE
type DTE2 = interface
    interface _DTE
Public Interface DTE2
Implements _DTE
Attributes
Implements

Examples

Sub DTEExample()  
  Dim objTextDoc As TextDocument  
  Dim objEP As EditPoint  

  'Create a new text document.  
  DTE2.ItemOperations.NewFile("General\Text File")  
  'Get a handle to the new document.  
  Set objTextDoc = DTE2.ActiveDocument.Object("TextDocument")  
  Set objEP = objTextDoc.StartPoint.CreateEditPoint  
  'Create an EditPoint and add some text.  
  objEP.Insert "A test sentence."  
End Sub  

Remarks

You can get the DTE automation object by calling GetService in the Initialize method.

DTE2 dte = (DTE2)GetService(typeof(DTE));

Properties

ActiveDocument ActiveDocument ActiveDocument ActiveDocument ActiveDocument ActiveDocument

Gets the active document.

ActiveSolutionProjects ActiveSolutionProjects ActiveSolutionProjects ActiveSolutionProjects ActiveSolutionProjects ActiveSolutionProjects

Gets an array of currently selected projects.

ActiveWindow ActiveWindow ActiveWindow ActiveWindow ActiveWindow ActiveWindow

Gets the currently active window, or the top-most window if no others are active.

AddIns AddIns AddIns AddIns AddIns AddIns

Gets the AddIns collection, which contains all currently available add-ins.

Application Application Application Application Application Application

Microsoft Internal Use Only.

CommandBars CommandBars CommandBars CommandBars CommandBars CommandBars

Gets a reference to the development environment's CommandBars object.

CommandLineArguments CommandLineArguments CommandLineArguments CommandLineArguments CommandLineArguments CommandLineArguments

Gets a string representing the command line arguments.

Commands Commands Commands Commands Commands Commands

Gets the Commands collection.

ContextAttributes ContextAttributes ContextAttributes ContextAttributes ContextAttributes ContextAttributes

Gets a ContextAttributes collection which allows automation clients to add new attributes to the current selected items in the Dynamic Help window and provide contextual help for the additional attributes.

Debugger Debugger Debugger Debugger Debugger Debugger

Gets the debugger objects.

DisplayMode DisplayMode DisplayMode DisplayMode DisplayMode DisplayMode

Gets or sets the display mode, either MDI or Tabbed Documents.

Documents Documents Documents Documents Documents Documents

Gets the collection of open documents in the development environment.

DTE DTE DTE DTE DTE DTE

Gets the top-level extensibility object.

Edition Edition Edition Edition Edition Edition

Gets a description of the edition of the environment.

Events Events Events Events Events Events

Gets a reference to the Events object.

FileName FileName FileName FileName FileName FileName

Microsoft Internal Use Only.

Find Find Find Find Find Find

Gets the Find object that represents global text find operations.

FullName FullName FullName FullName FullName FullName

Gets the full path and name of the object's file.

Globals Globals Globals Globals Globals Globals

Gets the Globals object that contains values that may be saved in the solution (.sln) file, the project file, or in the user's profile data.

IsOpenFile[String, String] IsOpenFile[String, String] IsOpenFile[String, String] IsOpenFile[String, String] IsOpenFile[String, String] IsOpenFile[String, String]

Microsoft Internal Use Only.

ItemOperations ItemOperations ItemOperations ItemOperations ItemOperations ItemOperations

Gets the ItemOperations object.

LocaleID LocaleID LocaleID LocaleID LocaleID LocaleID

Gets the ID of the locale in which the development environment is running.

Macros Macros Macros Macros Macros Macros

Gets the Macros object.

MacrosIDE MacrosIDE MacrosIDE MacrosIDE MacrosIDE MacrosIDE

Gets the root of the macro IDE automation model.

MainWindow MainWindow MainWindow MainWindow MainWindow MainWindow

Gets a Window object representing the main development environment window.

Mode Mode Mode Mode Mode Mode

Gets the mode of the development environment, either debug or design.

Name Name Name Name Name Name

Gets the name of the DTE.

ObjectExtenders ObjectExtenders ObjectExtenders ObjectExtenders ObjectExtenders ObjectExtenders

Gets the ObjectExtenders object.

Properties[String, String] Properties[String, String] Properties[String, String] Properties[String, String] Properties[String, String] Properties[String, String]

Gets a Properties collection representing all available categories and subcategories contained in the Options dialog box on the Tools menu.

RegistryRoot RegistryRoot RegistryRoot RegistryRoot RegistryRoot RegistryRoot

Gets a string with the path to the root of the Visual Studio registry settings.

SelectedItems SelectedItems SelectedItems SelectedItems SelectedItems SelectedItems

Gets a collection containing the items currently selected in the environment.

Solution Solution Solution Solution Solution Solution

Gets the Solution object that represents all open projects in the current instance of the environment and allows access to the build objects.

SourceControl SourceControl SourceControl SourceControl SourceControl SourceControl

Gets a SourceControl object that allows you to manipulate the source code control state of the file behind the object.

StatusBar StatusBar StatusBar StatusBar StatusBar StatusBar

Gets the StatusBar object, representing the status bar on the main development environment window.

SuppressUI SuppressUI SuppressUI SuppressUI SuppressUI SuppressUI

Gets or sets a value indicating whether user interface (UI) should be displayed during the execution of automation code.

ToolWindows ToolWindows ToolWindows ToolWindows ToolWindows ToolWindows

Gets a ToolWindows object used as a shortcut for finding tool windows.

UndoContext UndoContext UndoContext UndoContext UndoContext UndoContext

Gets the global UndoContext object.

UserControl UserControl UserControl UserControl UserControl UserControl

Gets a value indicating whether the environment was started by a user or by automation.

Version Version Version Version Version Version

Gets the host application's version number.

WindowConfigurations WindowConfigurations WindowConfigurations WindowConfigurations WindowConfigurations WindowConfigurations

Gets the WindowConfigurations collection, representing all available window configurations.

Windows Windows Windows Windows Windows Windows

Gets a Windows collection containing the windows that display in the object.

Methods

ExecuteCommand(String, String) ExecuteCommand(String, String) ExecuteCommand(String, String) ExecuteCommand(String, String) ExecuteCommand(String, String) ExecuteCommand(String, String)

Executes the specified command.

GetObject(String) GetObject(String) GetObject(String) GetObject(String) GetObject(String) GetObject(String)

Gets an interface or object that is late-bound to the DTE object and can be accessed by name at run time.

GetThemeColor(vsThemeColors) GetThemeColor(vsThemeColors) GetThemeColor(vsThemeColors) GetThemeColor(vsThemeColors) GetThemeColor(vsThemeColors) GetThemeColor(vsThemeColors)

Gets a color used to draw the user interface within Visual Studio.

LaunchWizard(String, Object[]) LaunchWizard(String, Object[]) LaunchWizard(String, Object[]) LaunchWizard(String, Object[]) LaunchWizard(String, Object[]) LaunchWizard(String, Object[])

Runs a wizard with the supplied parameters.

OpenFile(String, String) OpenFile(String, String) OpenFile(String, String) OpenFile(String, String) OpenFile(String, String) OpenFile(String, String)

Microsoft Internal Use Only.

Quit() Quit() Quit() Quit() Quit() Quit()

Closes the Visual Studio environment.

SatelliteDllPath(String, String) SatelliteDllPath(String, String) SatelliteDllPath(String, String) SatelliteDllPath(String, String) SatelliteDllPath(String, String) SatelliteDllPath(String, String)

Returns the computed path to the satellite DLL when given the installation directory for an application and the file name of the DLL containing localized resources.

Applies to