This topic has not yet been rated - Rate this topic

DTE Properties Collections

The environment-level properties are organized into categories. There are several predefined categories, each described in this topic, but Visual Studio .NET packages can add their own categories. Each category has a Properties collection for each package or service that contributes to the environment.

Note   Not every property page in the Options dialog box supports automation. The property pages that do support automation are listed below.

The same Properies Collection object can be accessed in different locations. For example, a properties collection for fonts and colors might be accessed with either DTE.Properties("Environment", "FontsAndColors") or DTE.Properties("TextEditor", "FontsAndColors").

Environment Properties

This section describes the pages (or properties collections) associated with the Environment category, DTE.Properties("Environment", <Property Page>). The title of each sub-section is the call to access the Properties collection, and the table in each sub-section lists the properties in the found in the collection.

General

DTE.Properties("Environment", "General")

Property Name Value Description
OnStartup Get/Let (vsStartup) Determines the environment's behavior on startup, whether to show the home page, the New Project dialog box, the Open Project dialog box, the last solution, and so forth.
ShowStatusBar Get/Let (Boolean) Determines whether the Status Bar is visible.
WindowMenuContainsNItems Get/Let (Short) Determines how document windows are contained at the bottom of the Windows menu.
MRUListContainsNItems Get/Let (Short) Determines how many files display in the "Most Recently Used" sub-menu.
Animations Get/Let (Boolean) Determines whether the IDE uses animation in the Status Bar.
AnimationSpeed Get/Let (Boolean) Determines the speed of animations in the Status Bar.
ShowCommandWindowCompletion Get/Let (Boolean) Determines whether the Command window displays completion UI as you type.
FindReplaceShowMessageBoxes Get/Let (Boolean) Determines whether various Find and Replace dialog boxes are displayed, such as whether or not to display the dialog box warning that a search wrapped past the starting point.
FindReplaceInitializeFromEditor Get/Let (Boolean) Determines whether initiating a search from the Find dialog box seeds the search pattern from the active documents insertion point location, or with the last pattern searched for in the IDE.

Documents

DTE.Properties("Environment", "Documents")

Property Name Value Description
ReuseSavedActiveDocWindow Get/Let (Boolean) Determines whether opening a new file reuses the current document window if the current document is saved. False means always open a new document window for each document opened.
DetectFileChangesOutsideIDE Get/Let (Boolean) Determines whether the environment automatically reloads files opened in the IDE when the operating system notifies the IDE that the files have been modifed on disk.
AutoloadExternalChanges Get/Let (Boolean) Determines whether detected external modifications to open documents should automatically reload the modified file if the open document is not modified. If the open document is modified, and this property is True, then the IDE prompts as if this property were False.
InitializeOpenFileFromCurrentDocument Get/Let (Boolean) Determines whether the OpenFile command seeds the directory and filename from the last active document, or from the last place you opened a file.
MiscFilesProjectSavesLastNItems Get/Let (Short) Determines how many files the Miscellaneous Files Project records, so that the next time you use the IDE, you can see what you most recently had open as a miscellaneous file on disk.

Help

DTE.Properties("Environment", "Help")

Property Name Value Description
Language String Contains the LCID of the language, such as 1033 for English.
Collection String The name of the Help collection to use for Visual Studio .NET Help, such as "ms-help://msdnvs."
External Boolean Determines whether or not to view Help outside of the Visual Studio .NET IDE.

Keyboard

DTE.Properties("Environment", "Keyboard")

Property Name Value Description
Scheme Get/Let (String) Returns a string containing the full pathname of the .vsk file that is loaded, or "[default settings]" if none is loaded.

Projects and Solution

DTE.Properties("Environment", "ProjectsAndSolution")

Property Name Value Description
OnRunOrPreview Get/Let (vsBuildOptions) Determines whether the environment saves everything before previewing or running a built project.
ProjectsLocation Get/Let (String) Determines the default directory where the Add Project dialog box saves new projects.
ShowOutputWindowBeforeBuild Get/Let (Boolean) Determines whether starting a build should display the Output Window.
ShowTaskListAfterBuild Get/Let (Boolean) Determines whether an unsuccessful build operation should display the Task List when the build is done.

TaskList

DTE.Properties("Environment", "TaskList")

Property Name Value Description
ConfirmTaskDeletion Boolean Determines whether a confirmation box displays when deleting tasks from the Task List.
UserTaskWarning Boolean Determines whether you are warned when adding a user task that will not be shown.
CommentTokens SafeArray Returns a SafeArray of vsCommentToken structs. Each has the fields Name (string) and Priority (vsTaskItemPriority)

Web Browser

DTE.Properties("Environment", "WebBrowser")

Property Name Value Description
UseDefaultHomePage Boolean Determines whether or not to use the default home page.
HomePage String Represents the home page URL.
UseDefaultSearchPage Boolean Determines whether or not to use the default search page.
SearchPage String Represents the search page URL.
ViewSourceIn Enum vsBrowserViewSource (Source, Design, External).
ViewSourceExternalProgram String The pathname of the external source viewer.

Text Editor Properties

This section describes the pages (or properties collections) associated with the Text Editor category in the Options dialog box on the Tools menu. The title of each sub-section is the call used to access its Properties collection, and the table in each sub-section lists the properties of the collection.

General

DTE.Properties("TextEditor", "General")

Property Name Value Description
GoToAnchorAfterEscape Get/Let (Boolean) True means hitting escape while there is a selection causes the insertion point to move to where the action that created the selection was initiated. False moves the insertion point to the other end of the selection.
DragNDropTextEditing Get/Let (Boolean) Determines whether you can drag a selected region of text around in the document for copy or cut/paste operations.
HorizontalScrollBar Get/Let (Boolean) Determines whether there is a horizontal scrollbar on editor windows.
VerticalScrollBar Get/Let (Boolean) Determines whether there is a vertical scroll bar on editor windows.
SelectionMargin Get/Let (Boolean) Determines whether there is space at the left of the text pane for special selection operations, drawing breakpoint icons, and so forth.
MarginIndicatorBar Get/Let (Boolean) Determines whether there is a vertical line dividing the left margin of the text pane from the main body of the text pane.
UndoCaretActions Get/Let (Boolean) True means undo operations include insertion point motion, selection commands, and so forth, in addition to editing actions that modify the buffer.
AutoDelimiterHighlighting Get/Let (Boolean) Determines whether typing a closing delimiter causes the editor to highlight the opening delimiter. The editor always bolds the open delimiter regardless of the value of this property.

Plain Text

These properties are common for all editors in the IDE, but you can set them individually for each language supported, as shown below with "<SomeRegisteredLanguage>."

DTE.Properties("TextEditor", "PlainText")

-or-

DTE.Properties("TextEditor", "<SomeRegisteredLanguage>")

Property Name Value Description
AutoListMembers Get/Let (Boolean) Determines whether an available members list automatically pops up when a user types a period following a variable reference.
AutoListParams Get/Let (Boolean) Determines whether a description of an argument list automatically displays when the users types a '(' following a function name.
HideAdvancedMembers Get/Let (Boolean) Determines whether the statement completion lists all members or only the commonly used ones.
VirtualSpace Get/Let (Boolean) Determines whether white space characters are displayed as graphics. Setting this to True causes WordWrap to be set to False.
WordWrap Get/Let (Boolean) Determines whether the view wraps long lines at word boundaries. Setting this to True causes VirtualSpace to be set to False.
EnableLeftClickForURLs Get/Let (Boolean) Determines whether the editor underlines URLs and enables a single left-click for jumping to the URL in the system registered web browser.
IndentStyle Get/Let (IndentStyle) Determines the indenting style. Settings are: INDENT_NONE, INDENT_DEFAULT (block style), or INDENT_SMART.
TabSize Get/Let (Long) Represents the number of spaces a tab is equal to. LET'ing an integer outside the range 1..60 (inclusive) fails.
InsertTabs Get/Let (Boolean) True means to use TAB characters when indenting.
IndentSize Get/Let (Long) Represents the number of spaces that one indent level is equal to. LET'ing an integer outside the range 1..60 (inclusive) fails.
ShowLineNumbers Get/Let (Boolean) Determines whether the view of a core editor document displays line numbers along the left margin.
ShowNavigationBar Get/Let (Boolean) Determines whether the drop-down lists and buttons appear at the top of editor windows.

Fonts and Colors Properties

This sets the fonts and colors for a tool window that is registered to appear in the Fonts and Colorable Items dialog box. These windows are modeled this way rather than in the properties dialog box accessed from DTE.Properties("Environment", "FontsAndColors"). This supports the dynamic nature of groups of colorable items, which can change if Visual Studio .NET packages are installed or uninstalled from the system.

The following section shows an example registered window type and what properties you will see for each window.

Text Editor

DTE.Properties("FontsAndColors", "TextEditor")

-or-

DTE.Properties("FontsAndColors", "<SomeRegisteredWindowOrEditor>")

Property Name Value Description
FontFamily Get/Let (String) For example, "Courier New."
FontCharacterSet Get/Let (EnvDTE.FontCharSet) A vsFontCharSet value.
FontSize Get/Let (Short) For example, 10.
FontsAndColorsItems Get (FontsAndColorsItems) ColorableItems objects are contained in the FontsAndColorsItems collection and have the read-only Name property and read/write properties Foreground (OLE.Color), Background (OLE.Color), and Bold (Boolean).

See Also

Applies To: DTE Object

Did you find this helpful?
(1500 characters remaining)