protected static SelLevInfo[] ConvertVwEnvStackToSelLevInfo(IList<StackItem> locationStack, int cPropPrevRootLevel)
{
var location = new SelLevInfo[locationStack.Count];
for (int i = 0, iSelLevInfo = locationStack.Count - 1; i < locationStack.Count; i++, iSelLevInfo--)
{
StackItem item = locationStack[i];
location[iSelLevInfo] = item.ToSelLevInfo();
if (i > 0)
{
StackItem prevItem = locationStack[i - 1];
int tagLevel = location[iSelLevInfo].tag;
// See how many times the next outer level has seen the
// property for this level.
int cpropPrevious = prevItem.m_cpropPrev.GetCount(tagLevel);
location[iSelLevInfo].cpropPrevious = cpropPrevious;
}
else
{
location[iSelLevInfo].cpropPrevious = cPropPrevRootLevel;
}
}
//foreach (StackItem item in locationStack)
// m_location[iSelLevInfo--] = item.ToSelLevInfo();
return location;
}