Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
WindowConfigurations Interface
Collapse the table of content
Expand the table of content

WindowConfigurations Interface

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

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

[GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")]
public interface WindowConfigurations : IEnumerable

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: " + 
      colWinConfig.Count);

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

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;
    MessageBox.Show(strMsg);
}

Community Additions

ADD
Show:
© 2015 Microsoft