Пример #1
0
        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}.");
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <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
        }
Пример #4
0
        public ImmediateWeather GetData(string value)
        {
            WeatherService srv = new WeatherService();

            return(srv.GetWeather(srv.GetStream(value)));
        }