コード例 #1
0
        static void PopulateAllSuffixTotals(int listIndex)
        {
            SuffixChar sc;

            //Build each collections suffixList based on all of the elements that went after it.

            if (listIndex == 0)
            //Last Number keyed in always has suffixCharsTotal that match suffixChars
            {
                listCurNumbers[listIndex].suffixCharsTotal = listCurNumbers[listIndex].suffixChars;
            }
            else
            {
                //All other keys - Create suffixCharsTotal list (whether it is part of the output or not)
                foreach (SuffixChar sc1 in listCurNumbers[listIndex].suffixChars)
                {
                    foreach (SuffixChar sc2 in listCurNumbers[listIndex - 1].suffixCharsTotal)
                    {
                        sc        = new SuffixChar();
                        sc.suffix = sc1.suffix + sc2.suffix;
                        listCurNumbers[listIndex].suffixCharsTotal.Add(sc);
                    }
                }
            }
        }
コード例 #2
0
        public static List <SuffixChar> GetSuffixChars(int keyNum)
        {
            List <SuffixChar> returnList = new List <SuffixChar>();
            SuffixChar        curChar    = new SuffixChar();

            //All keys will have at least 1 suffix char
            curChar.suffix = keyList[keyNum, 0];
            returnList.Add(curChar);

            if (keyNum > 1)
            {
                //keys > 1 have at least 3 suffix chars
                curChar        = new SuffixChar();
                curChar.suffix = keyList[keyNum, 1];
                returnList.Add(curChar);

                curChar        = new SuffixChar();
                curChar.suffix = keyList[keyNum, 2];
                returnList.Add(curChar);
            }

            if (keyNum == 7 || keyNum == 9)
            {
                //4th suffix char added for keys 7 and 9
                curChar        = new SuffixChar();
                curChar.suffix = keyList[keyNum, 3];
                returnList.Add(curChar);
            }

            return(returnList);
        }