Freigeben über


ProjectItem.FileCount-Eigenschaft

Ruft die Anzahl der Dateien ab, die einer ProjectItem zugeordnet sind.

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

Syntax

'Declaration
ReadOnly Property FileCount As Short
short FileCount { get; }
property short FileCount {
    short get ();
}
abstract FileCount : int16 with get
function get FileCount () : short

Eigenschaftswert

Typ: Int16
Ein Short Integer, der die Anzahl der Dateien angibt, die einer ProjectItem zugeordnet sind.

Hinweise

Die meisten Projektelemente bestehen nur aus einer Datei, manche können mehrere, aber wie bei Formularen in Visual Basic , die als FRM (Text) und FRX-Datei (binär)-Dateien gespeichert sind.

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);
}

.NET Framework-Sicherheit

Siehe auch

Referenz

ProjectItem Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell