다음을 통해 공유


ProjectItem.FileCount 속성

연결 된 파일의 수를 가져옵니다는 ProjectItem.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
ReadOnly Property FileCount As Short
short FileCount { get; }
property short FileCount {
    short get ();
}
abstract FileCount : int16 with get
function get FileCount () : short

속성 값

형식: Int16
연결 된 파일의 수를 나타내는 정수 (short)는 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 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행