ProjectItems.AddFolder(String, String) Methode

Definition

Erstellt in Projektmappen-Explorer einen neuen Ordner.

EnvDTE::ProjectItem AddFolder(std::wstring const & Name, std::wstring const & Kind = "{6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C}");
[System.Runtime.InteropServices.DispId(206)]
public EnvDTE.ProjectItem AddFolder (string Name, string Kind = "{6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C}");
[<System.Runtime.InteropServices.DispId(206)>]
abstract member AddFolder : string * string -> EnvDTE.ProjectItem
Public Function AddFolder (Name As String, Optional Kind As String = "{6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C}") As ProjectItem

Parameter

Name
String

Erforderlich. Der Name des Ordner Knotens in Projektmappen-Explorer.

Kind
String

(Optional) Der Typ des hinzuzufügenden Ordners.

Gibt zurück

ProjectItem

Ein ProjectItem-Objekt.

Attribute

Beispiele

Dieses Beispiel funktioniert nur in Visual Studio .NET 2003. Weitere Informationen finden Sie unter Migrieren von Code, der Projekte mithilfe von Vorlagen erstellt.

Sub AddFolderExample()  
   ' This function creates a solution and adds a Visual Basic Console  
   ' project to it.   
   Dim soln As Solution  
   Dim proj As Project  
   Dim projitems As ProjectItems  

   ' Create a reference to the solution.  
   soln = DTE.Solution  

   ' Create a new solution.  
   soln.Create("c:\temp2", "MyNewSolution")  

   ' Create a new Visual Basic Console application project.  
   ' Adjust the save path as needed.  
   proj = soln.AddFromTemplate("C:\Program Files\Microsoft Visual Studio .NET\Vb7\VBWizards\ConsoleApplication\Templates\1033\ConsoleApplication.vbproj", "c:\temp2", "My New Project", True)  
   projitems = proj.ProjectItems  

   ' Add a folder.  
   projitems.AddFolder("A New Folder")  
End Sub  

Hinweise

AddFolder Fügt dem Projekt und der Auflistung einen Ordner hinzu ProjectItems und gibt das neu erstellte- ProjectItem Objekt zurück. Die Auflistung ProjectItems ist leer. Einige Projekttypen unterstützen das Hinzufügen bestimmter Arten von Ordnern nicht (z vsProjectItemKindVirtualFolder . b.).

Gilt für