次の方法で共有


WindowConfiguration.Apply メソッド

以前に保存した名前付きウィンドウ構成を呼び出します。

名前空間:  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
    型 : 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 セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

WindowConfiguration インターフェイス

EnvDTE 名前空間

その他の技術情報

WindowConfiguration の作成例

WindowConfiguration の選択の例