示例#1
0
文件: City.cs 项目: G-IT-ED/vk
        internal static City FromJson(VkResponse response)
        {
            var city = new City();

            VkResponse id = response["cid"] ?? response["id"];
            city.Id = Convert.ToInt64(id.ToString());
            city.Title = response["title"] ?? response["name"];
            city.Area = response["area"];
            city.Region = response["region"];
            city.Important = response["important"] ?? false;

            return city;
        }
示例#2
0
			public CityViewModel(City city)
			{
				City = city;
			}
示例#3
0
		public static IEnumerable<University> GetTopUniversities(City city, Country country)
		{
			while (true)
			{
				try
				{
					return App.VkApi.Database.GetUniversities(Convert.ToInt32(country.Id), Convert.ToInt32(city.Id));
				}
				catch (UserAuthorizationFailException)
				{
					App.RequestAuth();
				}
				catch (TooManyRequestsException)
				{
					Thread.Sleep(250);
				}
			}
		}
示例#4
0
		public static IEnumerable<University> GetAllUnivercities(City city, Country country)
		{
			//TODO: Implement fetching all universities
			throw new NotImplementedException();
		}