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
Post a Comment