DataObjects.Count - Propriété
Obtient le nombre d'objets DataSourceObject contenus dans la collection DataObjectsCollection .
Espace de noms : Microsoft.Office.Interop.InfoPath
Assembly : Microsoft.Office.Interop.InfoPath (dans Microsoft.Office.Interop.InfoPath.dll)
Syntaxe
'Déclaration
ReadOnly Property Count As Integer
Get
'Utilisation
Dim instance As DataObjects
Dim value As Integer
value = instance.Count
int Count { get; }
Valeur de propriété
Type : System.Int32
Exemples
Dans l'exemple suivant, la propriété Count est utilisée dans une boucle For pour itération dans la collection d'objets DataObject et pour afficher une alerte indiquant le nom de chaque objet DataObject associé au formulaire :
for (int i=0; i < thisXDocument.DataObjects.Count; i++)
{
DataObject thisDataAdapter = thisXDocument.DataObjects[i];
thisXDocument.UI.Alert("DataObject name: " + thisDataAdapter.Name);
}