この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。
訳文
原文
このトピックはまだ評価されていません - このトピックを評価する

WindowConfigurations インターフェイス

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

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)
[GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")]
public interface WindowConfigurations : IEnumerable

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

  名前 説明
パブリック プロパティ ActiveConfigurationName 現在アクティブなウィンドウ構成の名前を取得します。
パブリック プロパティ Count コレクション内のオブジェクトの数を示す値を取得します。
パブリック プロパティ DTE トップレベルの機能拡張オブジェクトを取得します。
パブリック プロパティ Parent WindowConfigurations コレクションの直接の親オブジェクトを取得します。
このページのトップへ
  名前 説明
パブリック メソッド Add 現在のウィンドウの配置状態に基づいて新しい名前付きウィンドウ構成を作成し、その構成を WindowConfigurations コレクションに追加して、今後の呼び出しのために保持します。
パブリック メソッド GetEnumerator() コレクションを反復処理する列挙子を返します。 (IEnumerable から継承されます。)
パブリック メソッド GetEnumerator() コレクション内の項目の列挙体を取得します。
パブリック メソッド Item WindowConfigurations コレクションのインデックス付きメンバーを返します。
このページのトップへ

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

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);
}
この情報は役に立ちましたか。
(残り 1500 文字)
コミュニティ コンテンツ 追加
注釈 FAQ