次の方法で共有


WindowConfiguration インターフェイス

WindowConfiguration オブジェクトは、Visual Studio 環境のすべてのウィンドウに関するレイアウトと構成を表します。

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)

構文

'宣言
<GuidAttribute("41D02413-8A67-4C28-A980-AD7539ED415D")> _
Public Interface WindowConfiguration
[GuidAttribute("41D02413-8A67-4C28-A980-AD7539ED415D")]
public interface WindowConfiguration
[GuidAttribute(L"41D02413-8A67-4C28-A980-AD7539ED415D")]
public interface class WindowConfiguration
[<GuidAttribute("41D02413-8A67-4C28-A980-AD7539ED415D")>]
type WindowConfiguration =  interface end
public interface WindowConfiguration

WindowConfiguration 型で公開されるメンバーは以下のとおりです。

プロパティ

  名前 説明
パブリック プロパティ Collection このプロパティをサポートしているオブジェクトまたはこのコード コンストラクターに含まれているオブジェクトを含むコレクションを取得します。
パブリック プロパティ DTE トップレベルの機能拡張オブジェクトを取得します。
パブリック プロパティ Name オブジェクトの名前を設定または取得します。

このページのトップへ

メソッド

  名前 説明
パブリック メソッド Apply 以前に保存した名前付きウィンドウ構成を呼び出します。
パブリック メソッド Delete コレクションからウィンドウ構成を削除します。
パブリック メソッド Update コレクションを更新して、[アドイン マネージャー] ダイアログ ボックスを開いたり、またはオブジェクトのウィンドウ レイアウトを現在のウィンドウ レイアウトに設定したりするのと同様にします。

このページのトップへ

解説

現在のウィンドウのレイアウトに名前を付けて、ウィンドウ構成として Visual Studio 環境に保存できます。 Apply メソッドを使用すると、この構成を表す WindowConfiguration オブジェクトを後で呼び出すことができます。

Sub WinConfigExample1(ByVal dte As DTE)
    ' This example lists all currently available named window 
    ' configurations.
    ' Set references to all necessary objects.
    Dim colWinConfig As WindowConfigurations
    Dim objWinConfig As WindowConfiguration

    colWinConfig = dte.WindowConfigurations

    MsgBox("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()
    MsgBox("Number of configurations: " & colWinConfig.Count)
    FillMsg(colWinConfig)
End Sub

Sub FillMsg(ByVal colWinConfig As Object)
    ' Lists all currently available named window configurations.
    Dim lCtr As Integer
    Dim strMsg As String

    For lCtr = 1 To colWinConfig.Count
    strMsg = strMsg & "Configuration name " & lCtr & ": " & _
    colWinConfig.Item(lCtr).Name & vbCr
    Next lCtr
    strMsg = "Current Configurations: " & vbCr & strMsg
    MsgBox(strMsg)
End Sub
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);
}

参照

関連項目

EnvDTE 名前空間

その他の技術情報

WindowConfiguration の作成例

WindowConfiguration の選択の例