この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 |
訳文
原文
|
WindowConfiguration インターフェイス
WindowConfiguration オブジェクトは、Visual Studio 環境のすべてのウィンドウに関するレイアウトと構成を表します。
アセンブリ: EnvDTE (EnvDTE.dll 内)
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); }