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

WindowConfiguration インターフェイス

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

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)
[GuidAttribute("41D02413-8A67-4C28-A980-AD7539ED415D")]
public interface WindowConfiguration

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

  名前 説明
パブリック プロパティ Collection このプロパティをサポートしているオブジェクトまたはこのコード コンストラクターに含まれているオブジェクトを含むコレクションを取得します。
パブリック プロパティ DTE トップレベルの機能拡張オブジェクトを取得します。
パブリック プロパティ Name オブジェクトの名前を設定または取得します。
このページのトップへ
  名前 説明
パブリック メソッド Apply 以前に保存した名前付きウィンドウ構成を呼び出します。
パブリック メソッド Delete コレクションからウィンドウ構成を削除します。
パブリック メソッド Update コレクションを更新して、[アドイン マネージャー] ダイアログ ボックスを開いたり、またはオブジェクトのウィンドウ レイアウトを現在のウィンドウ レイアウトに設定したりするのと同様にします。
このページのトップへ

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

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