internal int Level(string qmark, int expectedLevel)
{
if (expectedLevel > 0 && expectedLevel <= m_quoteMarks.Levels)
{
// Check the expected level first. If it matches the opening or the closing, then
// the expected level is considered to be the level of the mark.
if (m_quoteMarks[expectedLevel - 1].Opening == qmark ||
m_quoteMarks[expectedLevel - 1].Closing == qmark)
return expectedLevel;
}
for (int i = 0; i < m_quoteMarks.Levels; i++)
{
if (qmark == m_quoteMarks[i].Opening || qmark == m_quoteMarks[i].Closing)
return i + 1;
}
return 0;
}