_NewEnum
Cette propriété prend en charge une énumération standard spécifique au langage.
Signature
_NewEnum : IUnknown |
Erreurs
Code d’erreur : | Description |
---|---|
1500 | L’objet n’est plus valide. |
Exemples
// ------------------------------------------------------------ // JScript sample - enumeration of a project's project items. function AllChildrenOfProjectRoot() { objProject = objMapForce.ActiveProject; if ( objProject != null ) { for ( objProjectIter = new Enumerator(objProject); ! objProjectIter.atEnd(); objProjectIter.moveNext() ) { objProjectItem = objProjectItemIter.item();
// do something with project item here } } } |
// ------------------------------------------------------------ // JScript sample - iterate all project items, depth first. function IterateProjectItemsRec(objProjectItemIter) { while ( ! objProjectItemIter.atEnd() ) { objProjectItem = objProjectItemIter.item(); // do something with project item here
IterateProjectItemsRec( new Enumerator(objProjectItem) );
objProjectItemIter.moveNext(); } } function IterateAllProjectItems() { objProject = objMapForce.ActiveProject; if ( objProject != null ) { IterateProjectItemsRec( new Enumerator(objProject) ); } } |