예제 #1
0
        public void print()
        {
            CLI.setConsoleForegroundColor(ConsoleColor.Yellow);
            Console.WriteLine("{");
            int i = 0;

            foreach (KeyValuePair <string, JSONType> kvp in map)
            {
                CLI.setConsoleForegroundColor(ConsoleColor.DarkCyan);
                Console.Write($"   {kvp.Key}: ");
                CLI.setConsoleForegroundColor(ConsoleColor.Green);
                Console.Write($"{kvp.Value}");
                CLI.setConsoleForegroundColor(ConsoleColor.White);
                if (i < map.Count - 1)
                {
                    Console.Write(",\n");
                }
                else
                {
                    Console.Write("\n");
                }
                i++;
            }

            CLI.setConsoleForegroundColor(ConsoleColor.Yellow);
            Console.WriteLine("}");
            CLI.resetConsoleForegroundColor();
        }
예제 #2
0
        public void printKeys()
        {
            Console.Write("Keys: [");
            int i = 0;

            foreach (KeyValuePair <string, JSONType> kvp in map)
            {
                CLI.setConsoleForegroundColor(ConsoleColor.DarkBlue);
                Console.Write(kvp.Key);
                CLI.resetConsoleForegroundColor();
                if (i < map.Count - 1)
                {
                    Console.Write(", ");
                }
                else
                {
                    Console.Write("]");
                }
                i++;
            }
        }