Ejemplo n.º 1
0
        static public string GetNextRoomId(string currentId)
        {
            if (LatinAlphabet == null)
            {
                LatinAlphabet = new List <char>();
                for (char c = 'A'; c <= 'Z'; ++c)
                {
                    LatinAlphabet.Add(c);
                }
            }

            string newId;

            if (currentId != null && currentId.Length > 0)
            {
                char lastChar      = currentId[currentId.Length - 1];
                int  nextCharIndex = LatinAlphabet.IndexOf(lastChar) + 1;

                if (nextCharIndex >= LatinAlphabet.Count)
                {
                    newId = currentId + LatinAlphabet[0].ToString();
                }
                else
                {
                    newId = LatinAlphabet[nextCharIndex].ToString();
                }
            }
            else
            {
                newId = LatinAlphabet[0].ToString();
            }

            return(newId);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Lists the small letters.
 /// </summary>
 /// <returns>All small letters.</returns>
 public static IEnumerable <string> SmallLetters()
 => LatinAlphabet.SmallLetters();
Ejemplo n.º 3
0
 /// <summary>
 /// Lists the capital letters.
 /// </summary>
 /// <returns>All captial letters.</returns>
 public static IEnumerable <string> CapitalLetters()
 => LatinAlphabet.CapitalLetters();