ProjectItem.FileCount Eigenschaft

Definition

Ruft die Anzahl der Dateien ab, die einer ProjectItem zugeordnet sind.Gets the number of files associated with a ProjectItem.

public:
 property short FileCount { short get(); };
public:
 property short FileCount { short get(); };
[System.Runtime.InteropServices.DispId(13)]
public short FileCount { [System.Runtime.InteropServices.DispId(13)] get; }
[<System.Runtime.InteropServices.DispId(13)>]
[<get: System.Runtime.InteropServices.DispId(13)>]
member this.FileCount : int16
Public ReadOnly Property FileCount As Short

Eigenschaftswert

Int16

Ein Short Integer, der die Anzahl der Dateien angibt, die einer ProjectItem zugeordnet sind.A short integer indicating the number of files associated with a ProjectItem.

Attribute

Beispiele

Sub FileCountExample(ByVal dte As DTE2)  

    ' Before running this example, open a project.  

    Dim proj As Project = dte.Solution.Projects.Item(1)  
    Dim item As ProjectItem  
    Dim items As String  

    For Each item In proj.ProjectItems  
        items &= "    " & item.Name & " (FileCount = " & _  
            item.FileCount & ")" & vbCrLf  
    Next  

    MsgBox(proj.Name & " has the following project items:" & _  
        vbCrLf & vbCrLf & items)  

End Sub  
public void FileCountExample(DTE2 dte)  
{  
    // Before running this example, open a project.  

    Project proj = dte.Solution.Projects.Item(1);  
    string items = "";  

    foreach (ProjectItem item in proj.ProjectItems)  
        items += "    " + item.Name + " (FileCount = " +   
            item.FileCount + ")\n";  

    MessageBox.Show(proj.Name +   
        " has the following project items:\n\n" + items);  
}  

Hinweise

Die meisten Projekt Elemente bestehen nur aus einer Datei, aber einige können mehr als eine Datei haben, wie z. b. Formulare in, Visual BasicVisual Basic die sowohl als *. frm (Text)-als auch als *. frx (Binary)-Dateien gespeichert werden.Most project items consist of only one file, but some can have more than one, as with forms in Visual BasicVisual Basic that are saved as both .frm (text) and .frx (binary) files.

Gilt für: