private void DetermineTypes(BidiChain chain) { CharType type = CharType.Nil; UnicodeLocator locator = new UnicodeLocator(); UnicodeAgent agent = locator.Agent; locator.LoadString(_text); while (locator.MoveNext()) { CharType priorType = type; _types[agent.index] = type = CharTypeLookup.DetermineCharType(agent.unicode); switch (type) { case CharType.ON: case CharType.LRI: case CharType.RLI: case CharType.FSI: case CharType.PDI: case CharType.LRE: case CharType.RLE: case CharType.LRO: case CharType.RLO: case CharType.PDF: AddConsecutiveLink(chain, type, agent.index); break; default: if (priorType != type) { AddConsecutiveLink(chain, type, agent.index); } break; } if (agent.length == 2) { _types[agent.index + 1] = CharType.BN; if (priorType != CharType.BN) { AddConsecutiveLink(chain, CharType.BN, agent.index + 1); } } } AddConsecutiveLink(chain, CharType.Nil, _text.Length); }
public UnicodeLocator() { _agent = new UnicodeAgent(); Reset(); }