调用以前保存的命名窗口配置。
命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)
语法
声明
Sub Apply ( _
    FromCustomViews As Boolean _
)
void Apply(
    bool FromCustomViews
)
void Apply(
    [InAttribute] bool FromCustomViews
)
abstract Apply : 
        FromCustomViews:bool -> unit 
function Apply(
    FromCustomViews : boolean
)
参数
- FromCustomViews
 类型:System.Boolean
 如果此参数为 true,则搜索目标为持久性自定义窗口配置中的命名视图。如果此参数为 false,则搜索已安装的、预定义持久性窗口配置。默认值为 true。
备注
可以将 Visual Studio 环境中的当前窗口布局保存为命名窗口配置。 使用 WindowConfigurations 集合的 Item 方法可定位到所需配置,然后使用 Apply 方法可重新调用该配置。
示例
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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。