Exemplo n.º 1
0
        //Distance calculation
        private void Distance()
        {
            string code;

            Console.WriteLine("Give GC code which distance is shown");
            code = Console.ReadLine();
            int id = myReader.GetCacheID(code.ToUpper());

            if (id != -1)
            {
                Geocache geocache = myReader.GetCache(id);

                Console.WriteLine("Distance to {0} is {1:f2}m", code, geocache.GetDistance(home));
            }
            else
            {
                Console.WriteLine("Not found \"{0}\"", code);
            }
        }
Exemplo n.º 2
0
        //Shows on map user specified cache
        private void ShowOnMap()
        {
            string code;

            Console.WriteLine("Give GC code which show on map");
            code = Console.ReadLine();
            int id = myReader.GetCacheID(code.ToUpper());

            if (id != -1)
            {
                Geocache geocache = myReader.GetCache(id);

                MapPin mapPin = new MapPin(geocache as ILocate);
                mapPin.ShowOnMap(geocache.GC_Code);
            }
            else
            {
                Console.WriteLine("Not found \"{0}\"", code);
            }
        }