async Task DisplayWeather(IDialogContext context, GeoLocatorService.CoordinateInfo coord) { var weatherService = new WeatherService.WeatherService(); var forecast = await weatherService.GetCurrentConditions(coord.Latitude, coord.Longitude); await context.PostAsync($"The current conditions for {coord.CityState} are {forecast.Summary} and {forecast.CurrentTemp}."); }
/// <summary> /// </summary> /// <param name="sender"> /// </param> /// <param name="e"> /// </param> protected void Application_Start(object sender, EventArgs e) { var policyServer = new PolicyServer("clientaccesspolicy.xml"); IMessageServer messageServer = new MessageServer( IPAddress.Any, 4530, new JsonMessageSerializer(new List<Type>() { typeof(WeatherMessage), typeof(SubscribeMessage) })); ThreadPool.QueueUserWorkItem((o) => { policyServer.Start(); }); ThreadPool.QueueUserWorkItem((o) => { messageServer.Start(); }); var weatherService = new WeatherService(messageServer); }
/// <summary> /// The main entry point for the application. /// </summary> static void Main() { #if DEBUG WeatherService myService = new WeatherService(); myService.OnDebug(); System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite); #else ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new WeatherService() }; ServiceBase.Run(ServicesToRun); #endif }
public ImmediateWeather GetData(string value) { WeatherService srv = new WeatherService(); return(srv.GetWeather(srv.GetStream(value))); }