Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

_DTE Interface

The top-level object in the Visual Studio automation object model. Refer to _DTE for this functionality. Do not instantiate from this class.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

[GuidAttribute(L"04A72314-32E9-48E2-9B87-A63603454F3E")]
public interface class _DTE

The _DTE type exposes the following members.

  NameDescription
Public propertyActiveDocumentGets the active document.
Public propertyActiveSolutionProjectsGets an array of currently selected projects.
Public propertyActiveWindowReturns the currently active window, or the top-most window if no others are active.
Public propertyAddInsGets the AddIns collection, which contains all currently available add-ins.
Public propertyApplicationInfrastructure. Microsoft Internal Use Only.
Public propertyCommandBarsGets a reference to the development environment's command bars.
Public propertyCommandLineArgumentsGets a string representing the command line arguments.
Public propertyCommandsReturns the Commands collection.
Public propertyContextAttributesGets 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.
Public propertyDebuggerGets the debugger objects.
Public propertyDisplayModeGets the display mode, either MDI or Tabbed Documents.
Public propertyDocumentsGets the collection of open documents in the development environment.
Public propertyDTEGets the top-level extensibility object.
Public propertyEditionGets a description of the edition of the environment.
Public propertyEventsGets a reference to the Events object.
Public propertyFileNameInfrastructure. Microsoft Internal Use Only.
Public propertyFindGets the Find object that represents global text find operations.
Public propertyFullNameGets the full path and name of the object's file.
Public propertyGlobalsGets 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.
Public propertyIsOpenFileInfrastructure. Microsoft Internal Use Only.
Public propertyItemOperationsGets the ItemOperations object.
Public propertyLocaleIDGets the ID of the locale in which the development environment is running.
Public propertyMacrosGets the Macros object.
Public propertyMacrosIDEGets the root of the Macros IDE's automation model.
Public propertyMainWindowGets a Window object representing the main development environment window.
Public propertyModeGets the mode of the development environment, either debug or design.
Public propertyNameSets or gets the name of the _DTE object.
Public propertyObjectExtendersGets the ObjectExtenders object.
Public propertyPropertiesReturns a Properties collection representing all available categories and subcategories contained in the Options dialog box on the Tools menu.
Public propertyRegistryRootGets a string with the path to the root of the Visual Studio registry settings.
Public propertySelectedItemsGets a collection containing the items currently selected in the environment.
Public propertySolutionGets the Solution object that represents all open projects in the current instance of the environment and allows access to the build objects.
Public propertySourceControlGets a SourceControl object that allows you to manipulate the source code control state of the file behind the object.
Public propertyStatusBarGets the StatusBar object, representing the status bar on the main development environment window.
Public propertySuppressUIGets or sets whether UI should be displayed during the execution of automation code.
Public propertyUndoContextGets the global UndoContext object.
Public propertyUserControlSets or gets a value indicating whether the environment was launched by a user or by automation.
Public propertyVersionGets the host application's version number.
Public propertyWindowConfigurationsGets the WindowConfigurations collection, representing all available window configurations.
Public propertyWindowsGets a Windows collection containing the windows that display in the object.
Top

  NameDescription
Public methodExecuteCommandExecutes the specified command.
Public methodGetObjectGets an interface or object that is late-bound to the DTE object and can be accessed by name at run time.
Public methodLaunchWizardRuns a wizard with the supplied parameters.
Public methodOpenFileInfrastructure. Microsoft Internal Use Only.
Public methodQuitCloses the environment.
Public methodSatelliteDllPathReturns the computed path to the satellite DLL when given the installation directory and the file name of the DLL containing localized resources.
Top

You can get the DTE automation object by calling GetService in the Initialize method. DTE2 dte = (DTE2)GetService(typeof(DTE));

Show:
© 2015 Microsoft