示例#1
0
        public void Print(int depth = 0)
        {
            int c = 0;

            if (depth > 0)
            {
                for (int i = 0; i < depth; i++)
                {
                    while (c > colors.Length - 1)
                    {
                        c -= colors.Length;
                    }
                    ConsoleWrite.WriteColored(darkColors[c], "   |");
                    c++;
                }
            }

            while (c > colors.Length - 1)
            {
                c -= colors.Length;
            }

            ConsoleWrite.WriteLinesColored(this.completesString ? colors[c] : darkColors[c], (IsLeaf ? " " : " > ") + this.letter);

            foreach (TrieSet child in children.Values.OrderBy(x => x.children.Count))
            {
                child.Print(depth + 1);
            }
        }