Exemplo n.º 1
0
        public MainVM()
        {
            Weather          = new CurrentWeatherInfo();
            FWeather         = new ForecastWeatherInfo();
            ClothesInfo      = new ClothesSetInfo();
            MainCommand      = new MainBtnCommand(this);
            DeletecolCommand = new DeleteColCombiCommand(this);
            Cnt        = 0;
            ClothesCnt = 0;

            ClothesInfo.ValueDic = setDictValue();

            //옷들 사이의 연결관계 만들기
            ClothesInfo.OuterBytop     = outerBytopSet();
            ClothesInfo.TopBytop       = topBytopSet();
            ClothesInfo.TopBybottom    = topBybottomSet();
            ClothesInfo.TopSolo        = topSoloSet();
            ClothesInfo.TopBybottomCol = topBybottomColSet();
            ClothesInfo.OuterByTopCol  = outerBytopColSet();
            ClothesInfo.OuterByBottom  = OuterByBottomSet();
            ClothesInfo.TopByskirt     = topByskirtSet();
            ClothesInfo.OuterBySkirt   = outerByskirtSet();
            ClothesInfo.TopBySkirtCol  = topByskirtColSet();

            RenewFiles();
            GetWeather();
            GetFWeather();
            SetClothes();
        }
Exemplo n.º 2
0
        public static ForecastWeatherInfo GetWeatherInformation(string cityName)
        {
            ForecastWeatherInfo result = new ForecastWeatherInfo();

            string url = string.Format(BASE_URL, cityName, API_KEY);

            using (HttpClient Client = new HttpClient())
            {
                var    response = Client.GetAsync(url);
                string json     = response.Result.Content.ReadAsStringAsync().Result;

                result = JsonConvert.DeserializeObject <ForecastWeatherInfo>(json);
            }
            return(result);
        }