コード例 #1
0
        public WindGenerator Update(string city)
        {
            var        binding   = new NetTcpBinding();
            IPEndPoint ipAddress = RoleEnvironment.Roles["WeatherWorkerRole"].Instances[0].InstanceEndpoints["InternalRequest"].IPEndpoint;
            ChannelFactory <IWeather> factory = new ChannelFactory <IWeather>(binding, new EndpointAddress($"net.tcp://{ipAddress}/InternalRequest"));

            proxy = factory.CreateChannel();

            return(proxy.GetWindGenerator(city));
        }
コード例 #2
0
 private void AddWeatherToList()
 {
     foreach (string city in cities)
     {
         this.Dispatcher.Invoke((Action)(() =>
         {
             windGenerators.Add(proxy.GetWindGenerator(city));
             g.Powers[city].Add(windGenerators[windGenerators.Count - 1].Power);
         }));
     }
 }