foreach怎么改成for语句
double mapScale;
foreach(LayerConfig lc in MOHelper.getInstance().GetLayerConfigs())
{
mapScale = lc.MapScale;
}怎么改成for语句
------解决方案--------------------double mapScale;
for(int i = 0; i < MOHelper.getInstance().GetLayerConfigs().Count; i++)
{
mapScale += lc.MapScale;
}
------解决方案--------------------double mapScale;
for(int i= 0 ; i < MOHelper.getInstance().GetLayerConfigs().count ; i++)
{
mapScale = MOHelper.getInstance().GetLayerConfigs()[i].MapScale;
}