مشاركة عبر


ProjectItem.FileCount الخاصية

Gets the رقم of ملفات associated مع a ProjectItem.

مساحة الاسم:  EnvDTE
التجميع:  EnvDTE (في EnvDTE.dll)

بناء الجملة

'إقرار
ReadOnly Property FileCount As Short
    Get
short FileCount { get; }
property short FileCount {
    short get ();
}
abstract FileCount : int16
function get FileCount () : short

قيمة الخاصية

النوع: System.Int16
قيمة عدد صحيح مختصر تشير إلى العدد ملفات المقترنة ProjectItem.

ملاحظات

تتكون معظم عناصر مشروع من ملف واحد فقط، ولكن بعض يمكن أن يكون لديك المزيد واحد، كـ مع النماذج في Visual Basicالتي تحفظ كـ.frm (نص) وملفات.frx (ثنائي).

أمثلة

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.

راجع أيضًَا

المرجع

ProjectItem واجهة

ProjectItem الأعضاء

EnvDTE مساحة الاسم

موارد أخرى

كيفية: الترجمة وإعادة تشغيل أمثلة التعليمات البرمجية لطراز كائن التنفيذ التلقائي