Freigeben über


WindowConfiguration.Apply(Boolean) Method

Definition

Invokes a previously saved named window configuration.

void Apply(bool FromCustomViews = true);
[System.Runtime.InteropServices.DispId(3)]
public void Apply (bool FromCustomViews = true);
[<System.Runtime.InteropServices.DispId(3)>]
abstract member Apply : bool -> unit
Public Sub Apply (Optional FromCustomViews As Boolean = true)

Parameters

FromCustomViews
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.

Attributes

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);  
}  

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.

Applies to