示例#1
0
        public static async Task Main(string[] args)
        {
            ICityBikeDataFetcher fetcher;

            fetcher = new RealTimeCityBikeDataFetcher();
            var   task = fetcher.GetBikeCountInStation("Petikontie");
            await task;
        }
        static void Main(string[] args)
        {
            string input     = args[0].ToString();
            var    a         = new RealTimeCityBikeDataFetcher();
            var    bikeCount = a.GetBikeCountInStation(input);

            Console.WriteLine("\n---- Response: " + bikeCount);
            if (bikeCount != null)
            {
                Console.WriteLine("Station " + input + " has " + bikeCount.Result + " bikes available");
            }
        }
示例#3
0
 static async Task Main(string[] args)
 {
     if (args[0].Equals("offline") || args[0].Equals("Offline"))
     {
         while (true)
         {
             OfflineCityBikeDataFetch fetch = new OfflineCityBikeDataFetch();
             Console.WriteLine("Anna haettavan aseman nimi: ");
             Console.WriteLine(await fetch.GetBikeCountInStation(Console.ReadLine()) + " pyörä(ä)");
         }
     }
     else if (args[0].Equals("Realtime") || args[0].Equals("realtime"))
     {
         while (true)
         {
             RealTimeCityBikeDataFetcher fetch = new RealTimeCityBikeDataFetcher();
             Console.WriteLine("Anna haettavan aseman nimi: ");
             Console.WriteLine(await fetch.GetBikeCountInStation(Console.ReadLine()) + " pyörä(ä)");
         }
     }
 }