Condividi tramite


Proprietà DataObjects.Count

Ottiene il numero di oggetti DataSourceObject contenuti nell'insieme DataObjectsCollection.

Questa proprietà non è compatibile con CLS.  

Spazio dei nomi: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)

Sintassi

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

Dim instance As DataObjects
Dim value As Integer

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

Osservazioni

Importante:

Non vi sono restrizioni per l'accesso a questo membro.

Esempio

Nell'esempio seguente, la proprietà Count viene utilizzata in un ciclo for per eseguire un'iterazione nell'insieme di oggetti DataObject e visualizzare un avviso con il nome di tutti gli oggetti DataObject associati al modulo:

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

Vedere anche

Riferimenti

Interfaccia DataObjects
Membri DataObjects
Spazio dei nomi Microsoft.Office.Interop.InfoPath.SemiTrust