ASP.NET Pack Programmer's Guide
Dictionary.count Property
See Also
 





Gets the number of key/value pairs contained in the Dictionary.

Namespace: MindFusion.Mapping
Package: Dictionary.js

 Syntax

JavaScript  Copy Code

Object.defineProperty(Dictionary.prototype, "count", { value: Number });

 Property Value

Number. The count of key/value pairs.

 Example

The following code creates a new Dictionary and adds LatLong instances with keys the cities they belong to. Then it checks if the count of Dictionary entries is more than 100 and alerts the user:

JavaScript  Copy Code

var m = MindFusion.Mapping;

var locations = new m.Dictionary();
locations.set("Paris", new m.LatLong(-22.951916, -43.210487));
locations.set("Sidney", new m.LatLong(40.284218, -84.155502));
locations.set("Lima", new m.LatLong(-12.046373, -77.042755));
...............

if(locations.count > 100)
   alert("You've reached the allowed limit!");

 See Also

Dictionary Members
Dictionary Class
MindFusion.Mapping Namespace