We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

WindowConfigurations Interface

The WindowConfigurations collection contains all named window configurations created for the environment.

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

public interface WindowConfigurations : IEnumerable

The WindowConfigurations type exposes the following members.

Public propertyActiveConfigurationNameGets the name of the currently active window configuration.
Public propertyCountGets a value indicating the number of objects in the collection.
Public propertyDTEGets the top-level extensibility object.
Public propertyParentGets the immediate parent object of a WindowConfigurations collection.

Public methodAddCreates a new named window configuration based on the current arrangement of windows, adds it to the WindowConfigurations collection, and retains it for future recall.
Public methodGetEnumeratorGets an enumeration for items in a collection.
Public methodItemReturns an indexed member of a WindowConfigurations collection.

You can save your current window layout in the Visual Studio environment as a named window configuration. The WindowConfigurations collection contains all such configurations.

void WinConfigExample1(_DTE dte)
// Set references to all necessary objects.
    WindowConfigurations colWinConfig; 
    WindowConfiguration objWinConfig;

    colWinConfig = dte.WindowConfigurations;

    MessageBox.Show("Number of configurations: " + 

    // List all saved named window configurations.
    // Create a new window configuration.
    objWinConfig = colWinConfig.Add("NewLayout");
    // Get rid of the new window configuration.
    MessageBox.Show("Number of configurations: " + colWinConfig.Count);

void FillMsg(WindowConfigurations colWinConfig )
        // Lists all currently available named window configurations.
    int lCtr;
    string strMsg = null;

    for (lCtr = 1; lCtr < colWinConfig.Count + 1; lCtr ++)
        strMsg = strMsg + "Configuration name " + lCtr + ": " + 
            colWinConfig.Item(lCtr).Name + "\n"; 
    strMsg = "Current Configurations: \n" + strMsg;