Esempio n. 1
0
 public Subsector this[char alpha]
 {
     get
     {
         return(Subsectors.Where(ss => ss.Index != null && ss.Index[0] == alpha).FirstOrDefault());
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public Subsector Subsector(char alpha)
 {
     return(Subsectors.Where(ss => ss.Index != null && ss.Index[0] == alpha).FirstOrDefault());
 }