Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In Listing 18.6, QuickJumpGrid uses a class called CharHelper to figure out which of the 27 “buckets” each string key belongs in (a-z or #). This class is implemented in Listing 18.7.
|
Code View:
Scroll
/
Show All using System; using System.Collections.Generic; namespace WindowsPhoneApp { public static class CharHelper { static Dictionary<char, char> accentMap = new Dictionary<char, char>(); static CharHelper() { // Map some common accented letters to non-accented letters accentMap.Add('à', 'a'); accentMap.Add('á', 'a'); accentMap.Add('â', 'a'); accentMap.Add('ã', 'a'); accentMap.Add('ä', 'a'); accentMap.Add(' |