public Subsector this[char alpha] { get { return(Subsectors.Where(ss => ss.Index != null && ss.Index[0] == alpha).FirstOrDefault()); } }
public int SubsectorIndexFor(string label) { if (string.IsNullOrWhiteSpace(label)) { return(-1); } Subsector subsector; if (label.Length == 1) { char c = char.ToUpperInvariant(label[0]); if (Util.InRange(c, 'A', 'P')) { return((int)c - (int)'A'); } } subsector = Subsectors.Where(ss => !string.IsNullOrEmpty(ss.Name) && ss.Name.Equals(label, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); return(subsector?.IndexNumber ?? -1); }
public Subsector Subsector(char alpha) { return(Subsectors.Where(ss => ss.Index != null && ss.Index[0] == alpha).FirstOrDefault()); }