ProjectItem Interface

 

Represents an item in a project.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

[GuidAttribute("0B48100A-473E-433C-AB8F-66B9739AB620")]
public interface ProjectItem

NameDescription
System_CAPS_pubpropertyCollection

Gets the ProjectItems collection containing the ProjectItem object supporting this property.

System_CAPS_pubpropertyConfigurationManager

Gets the ConfigurationManager object for this ProjectItem.

System_CAPS_pubpropertyContainingProject

Gets the project hosting the ProjectItem.

System_CAPS_pubpropertyDocument

Gets the Document associated with the item, if one exists.

System_CAPS_pubpropertyDTE

Gets the top-level extensibility object.

System_CAPS_pubpropertyExtender[String]

Gets the requested Extender if it is available for this object.

System_CAPS_pubpropertyExtenderCATID

Gets the Extender category ID (CATID) for the object.

System_CAPS_pubpropertyExtenderNames

Gets a list of available Extenders for the object.

System_CAPS_pubpropertyFileCodeModel

Gets the FileCodeModel object for the project item.

System_CAPS_pubpropertyFileCount

Gets the number of files associated with a ProjectItem.

System_CAPS_pubpropertyFileNames[Int16]

Gets the full path and names of the files associated with a project item.

System_CAPS_pubpropertyIsDirty

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

System_CAPS_pubpropertyIsOpen[String]

Gets a value indicating whether the project item is open in a particular view type.

System_CAPS_pubpropertyKind

Gets a GUID string indicating the kind or type of the object.

System_CAPS_pubpropertyName

Gets or sets the name of the object.

System_CAPS_pubpropertyObject

Gets an object that can be accessed by name at run time.

System_CAPS_pubpropertyProjectItems

Gets a ProjectItems for the object.

System_CAPS_pubpropertyProperties

Gets a collection of all properties that pertain to the object.

System_CAPS_pubpropertySaved

Gets or sets a value indicating whether or not the object has been modified since last being saved or opened.

System_CAPS_pubpropertySubProject

If the project item is the root of a subproject, then the SubProject property returns the Project object for the subproject.

NameDescription
System_CAPS_pubmethodDelete()

Removes the item from its project and its storage.

System_CAPS_pubmethodExpandView()

Expands the view of Solution Explorer to show project items.

System_CAPS_pubmethodOpen(String)

Opens the ProjectItem in the specified view.

System_CAPS_pubmethodRemove()

Removes the project item from the collection.

System_CAPS_pubmethodSave(String)

Saves the project or project item.

System_CAPS_pubmethodSaveAs(String)

Saves the project item.

' 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
Return to top
Show: