この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 |
訳文
原文
|
ProjectItems インターフェイス
ProjectItem オブジェクトを含みます。各オブジェクトがプロジェクトの項目を表します。
アセンブリ: EnvDTE (EnvDTE.dll 内)
ProjectItems 型で公開されるメンバーは以下のとおりです。
| 名前 | 説明 | |
|---|---|---|
|
ContainingProject | 1 つ以上のプロジェクト項目をホストするプロジェクトを取得します。 |
|
Count | コレクション内のオブジェクトの数を示す値を取得します。 |
|
DTE | トップ レベルの機能拡張オブジェクトを取得します。 |
|
Kind | オブジェクトの型を示す列挙値を取得します。 |
|
Parent | ProjectItems コレクションの直接の親オブジェクトを取得します。 |
| 名前 | 説明 | |
|---|---|---|
|
AddFolder | ソリューション エクスプローラーに新規のフォルダーを作成します。 |
|
AddFromDirectory | ディレクトリから 1 つ以上の ProjectItem オブジェクトを ProjectItems コレクションに追加します。 |
|
AddFromFile | プロジェクトのディレクトリ構造にインストールされたファイルから、プロジェクト項目を追加します。 |
|
AddFromFileCopy | ソース ファイルをコピーし、プロジェクトに追加します。 |
|
AddFromTemplate | 既存の項目テンプレート ファイルから新しいプロジェクト項目を作成し、プロジェクトに追加します。 |
|
GetEnumerator() | コレクションを反復処理する列挙子を返します。 (IEnumerable から継承されます。) |
|
GetEnumerator() | コレクション内の項目の列挙を返します。 |
|
Item | ProjectItems コレクション内の ProjectItem オブジェクトを返します。 |
' Before running, create a new project or open an existing project. Sub ListProj() Dim proj As Project = DTE.ActiveSolutionProjects(0) Dim win As Window = _ DTE.Windows.Item(Constants.vsWindowKindCommandWindow) ListProjAux(proj.ProjectItems(), 0) End Sub Sub ListProjAux(ByVal projitems As ProjectItems, ByVal Level As Integer) Dim projitem As ProjectItem For Each projitem In projitems MsgBox("Project item: " & projitem.Name, Level) ' Recurse if the project item has sub-items... Dim projitems2 As ProjectItems projitems2 = projitem.ProjectItems Dim notsubcoll As Boolean = projitems2 Is Nothing If Not notsubcoll Then ListProjAux(projitems2, Level + 1) End If Next End Sub