예제 #1
0
        static void Main(string[] args)
        {
            var jc = new SimpleJonesClient(service: "yoda", callback: (d => {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("config has changed: we now have {0} config items", d.Keys.Count);
                Console.ForegroundColor = ConsoleColor.Gray;

                foreach (var k in d.Keys)
                {
                    Console.WriteLine("{0} = {1}", k, d[k]);
                }

                Console.WriteLine("-");

            }));

            Console.WriteLine("hello, world!");
            Console.WriteLine("service {0} has {1} config items", jc.ServiceName, jc.Config.Keys.Count);
            foreach (var key in jc.Config.Keys)
            {
                Console.WriteLine("{0} = {1}", key, jc.Config[key]);
            }

            Console.WriteLine("-");
            Console.ReadKey(false);
        }
예제 #2
0
        public void TestCreateSimpleJonesClient()
        {
            var jc = new SimpleJonesClient(service: "yoda");

            //while (true)
            {
                System.Threading.Thread.Sleep(1000);

                foreach (var key in jc.Config.Keys)
                {
                    Console.WriteLine("{0} = {1}", key, jc.Config[key]);
                }
            }
            System.Console.ReadLine();
        }