ProjectItems::Item Method (Object^)
Visual Studio 2015
Returns a ProjectItem object in a ProjectItems collection.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- index
-
Type:
System::Object^
Required. The index of the ProjectItem object to return.
The value passed to Index is either an integer that is an index to a ProjectItem object in the ProjectItems collection or the UniqueName of a ProjectItem object in the collection.
The Item method throws a ArgumentException exception if the collection cannot find the object that corresponds to the index or UniqueName value.
' Before running, create a solution with an empty project named ' "Project1". Sub ThrowArgumentException() ' Projects of the current solution. Dim cprojects As Projects = DTE.Solution.Projects Dim project1 As Project = cprojects.Item(1) Debug.Assert(cprojects.Item(project1.UniqueName) Is project1) End Sub
Show: