Share via


WindowConfigurations インターフェイス

WindowConfigurations コレクションには、その環境に作成されたすべての名前付きウィンドウ構成が含まれます。

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

構文

'宣言
<GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")> _
Public Interface WindowConfigurations _
    Inherits IEnumerable
[GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")]
public interface WindowConfigurations : IEnumerable
[GuidAttribute(L"E577442A-98E1-46C5-BD2E-D25807EC81CE")]
public interface class WindowConfigurations : IEnumerable
[<GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")>]
type WindowConfigurations =  
    interface 
        interface IEnumerable 
    end
public interface WindowConfigurations extends IEnumerable

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

プロパティ

  名前 説明
パブリック プロパティ ActiveConfigurationName 現在アクティブなウィンドウ構成の名前を取得します。
パブリック プロパティ Count コレクション内のオブジェクトの数を示す値を取得します。
パブリック プロパティ DTE トップレベルの機能拡張オブジェクトを取得します。
パブリック プロパティ Parent WindowConfigurations コレクションの直接の親オブジェクトを取得します。

このページのトップへ

メソッド

  名前 説明
パブリック メソッド Add 現在のウィンドウの配置状態に基づいて新しい名前付きウィンドウ構成を作成し、その構成を WindowConfigurations コレクションに追加して、今後の呼び出しのために保持します。
パブリック メソッド GetEnumerator コレクション内の項目の列挙子を取得します。
パブリック メソッド Item WindowConfigurations コレクションのインデックス付きメンバーを返します。

このページのトップへ

解説

現在のウィンドウのレイアウトに名前を付けて、ウィンドウ構成として Visual Studio 環境に保存できます。 WindowConfigurations コレクションには、保存したウィンドウ構成がすべて含まれます。

Sub WinConfigurationsExample(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 の選択の例