c# - How to find the number of items in a DynamicNodeList? -


is there property or function dynamicnodelist returns number of list items.

this code:

var root = model.nodebyid(id); var nodes = root.descendants("chartitem");  if (nodes.getlength() > 0) {    s = s + "<ul>"; } 

but getlength not valid function. should do?

there built in extension method ienumerable types called count(), that, counts items :)

see code below:

var root = model.nodebyid(id); var nodes = root.descendants("chartitem");  if (nodes.count() > 0) {     s = s + "<ul>"; } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -