예제 #1
0
        /***
         * 获取所有当前可用地点
         */
        public static async Task <Places> getAllPlaces()
        {
            var    json      = JsonSerializer.Create();
            String placesStr = await BasicService.getRequest("getAllValidPlaces");

            return(json.Deserialize <Places>(new JsonTextReader(new StringReader(placesStr))));
        }
예제 #2
0
        /***
         * 获取所有Event
         */
        public static async Task <Events> getAllEvents()
        {
            var    json      = JsonSerializer.Create();
            String eventsStr = await BasicService.getRequest("getAllEvents");

            if (eventsStr == null)
            {
                return(null);
            }
            Events events = json.Deserialize <Events>(new JsonTextReader(new StringReader(eventsStr)));

            foreach (var eventItem in events.events)
            {
                eventItem.startTime = eventItem.startTime.ToLocalTime();
                eventItem.endTime   = eventItem.endTime.ToLocalTime();
            }

            return(events);
        }