Aracılığıyla paylaş


ProjectItem.FileCount Özellik

İlişkili dosyaları sayısını alır bir ProjectItem.

Ad alanı:  EnvDTE
Derleme:  EnvDTE (EnvDTE.dll içinde)

Sözdizimi

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

Özellik Değeri

Tür: System.Int16
İlişkili dosyaları sayısını belirten kısa bir tamsayý bir ProjectItem.

Notlar

Çoğu proje öğeleri yalnızca bir dosyasından oluşan, ancak bazı birden çok sahip formlar gibi olsun Visual Basic , .frm (metin) ve .frx (ikili) dosyaları kaydedilir.

Örnekler

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 Güvenliği

Ayrıca bkz.

Başvuru

ProjectItem Arabirim

EnvDTE Ad Alanı

Diğer Kaynaklar

Nasıl yapılır: derlemek ve Otomasyon nesne modeli kod örneklerini çalıştırmak