WindowConfiguration.Apply Method

Invokes a previously saved named window configuration.

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

Syntax

'Declaration
Sub Apply ( _
    FromCustomViews As Boolean _
)
void Apply(
    bool FromCustomViews
)
void Apply(
    [InAttribute] bool FromCustomViews
)
abstract Apply : 
        FromCustomViews:bool -> unit
function Apply(
    FromCustomViews : boolean
)

Parameters

  • FromCustomViews
    Type: System.Boolean

    If this is true, the named view in the custom window configuration persistence is the search target. If this is false, then the installed, predefined persistence of window configurations is searched. The default is true.

Remarks

You can save your current window layout in the Visual Studio environment as a named window configuration. Use the Item method of the WindowConfigurations collection to navigate to the desired configuration, and then use the Apply method to recall the configuration.

Examples

Sub ApplyExample(dte as DTE)
    ' Set references to all necessary objects.
    Dim colWinConfig As WindowConfigurations
    Dim objWinConfig As WindowConfiguration
    colWinConfig = dte.WindowConfigurations
    objWinConfig = colWinConfig.Item(2)

    ' List the current window configuration, then set it to another 
    ' one.
    MsgBox("Current active window configuration: " & _
    colWinConfig.ActiveConfigurationName)
    objWinConfig.Apply()
    MsgBox("Current active window configuration: " & _
    colWinConfig.ActiveConfigurationName)
End Sub
void ApplyExample(_DTE dte)
{
    // Set references to all necessary objects.
    WindowConfigurations colWinConfig;
    WindowConfiguration objWinConfig;
    colWinConfig = dte.WindowConfigurations;
    objWinConfig = colWinConfig.Item(2);

    // List the current window configuration, then set it to another 
    // one.
    MessageBox.Show("Current active window configuration: " + 
    colWinConfig.ActiveConfigurationName);
    objWinConfig.Apply(false);
    MessageBox.Show("Current active window configuration: " + 
    colWinConfig.ActiveConfigurationName);
}

.NET Framework Security

See Also

Reference

WindowConfiguration Interface

EnvDTE Namespace

Other Resources

WindowConfiguration Creation Example

WindowConfiguration Selection Example