다음을 통해 공유


DataObjects.Count 속성

DataObjectsCollection 컬렉션에 포함된 DataSourceObject 개체의 수를 가져옵니다.

이 속성은 CLS 규격이 아닙니다.  

네임스페이스: Microsoft.Office.Interop.InfoPath.SemiTrust
어셈블리: Microsoft.Office.Interop.InfoPath.SemiTrust(microsoft.office.interop.infopath.semitrust.dll)

구문

<DispIdAttribute(1)> _
ReadOnly Property Count As Integer

Dim instance As DataObjects
Dim value As Integer

value = instance.Count
[DispIdAttribute(1)] 
int Count { get; }

주의

중요:

이 멤버는 무제한 액세스할 수 있습니다.

예제

다음 예제에서는 for 루프 내에서 Count 속성을 사용하여 DataObject 개체의 컬렉션 전체를 반복하고 양식에 연결된 각 DataObject 개체의 이름을 나타내는 경고를 표시합니다.

for (int i=0; i < thisXDocument.DataObjects.Count; i++)
 {
 DataObject thisDataAdapter = thisXDocument.DataObjects[i];
 thisXDocument.UI.Alert("DataObject name: " + thisDataAdapter.Name);
 }

참고 항목

참조

DataObjects 인터페이스
DataObjects 구성원
Microsoft.Office.Interop.InfoPath.SemiTrust 네임스페이스