Пример #1
0
        private static void SetTime(Pebble pebble)
        {
            Console.WriteLine("Enter time <current>:");
            var time = Console.ReadLine();

            if (String.IsNullOrEmpty(time))
            {
                pebble.SetTime(DateTime.Now);
            }
            else
            {
                DateTime result;
                if (DateTime.TryParse(time, out result))
                {
                    pebble.SetTime(result);
                }
                else
                {
                    Console.WriteLine("invalid time");
                }
            }
        }