Example #1
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            name     = joDetails.TryGetValue("name", out jt) ? (string)jt : null;
            actor    = joDetails.TryGetValue("actor", out jt) ? (string)jt : null;
            director = joDetails.TryGetValue("director", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("category", out jt))
            {
                category = (VideoCategoryEnum)Enum.Parse(typeof(VideoCategoryEnum), (string)jt);
            }
            else
            {
                category = null;
            }
            tag     = joDetails.TryGetValue("tag", out jt) ? (string)jt : null;
            country = joDetails.TryGetValue("country", out jt) ? (string)jt : null;
            season  = joDetails.TryGetValue("season", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            episode = joDetails.TryGetValue("episode", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            if (joDetails.TryGetValue("sort", out jt))
            {
                sort = (VideoSortEnum)(int)jt;
            }
            else
            {
                sort = null;
            }
        }
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            location = joDetails.TryGetValue("location", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            price    = joDetails.TryGetValue("price", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            radius   = joDetails.TryGetValue("radius", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            keyword  = joDetails.TryGetValue("keyword", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("coupon", out jt))
            {
                coupon = (CouponEnum)(int)jt;
            }
            else
            {
                coupon = null;
            }
            if (joDetails.TryGetValue("sort", out jt))
            {
                sort = (CouponSortEnum)(int)jt;
            }
            else
            {
                sort = null;
            }
        }
Example #3
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            location = joDetails.TryGetValue("location", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            datetime = joDetails.TryGetValue("datetime", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
        }
Example #4
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            location   = joDetails.TryGetValue("location", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            start_date = joDetails.TryGetValue("start_date", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            end_date   = joDetails.TryGetValue("end_date", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            name       = joDetails.TryGetValue("name", out jt) ? (string)jt : null;
            price      = joDetails.TryGetValue("price", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            radius     = joDetails.TryGetValue("radius", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            if (joDetails.TryGetValue("level", out jt))
            {
                level = (HotelLevelEnum)Enum.Parse(typeof(HotelLevelEnum), (string)jt);
            }
            else
            {
                level = null;
            }
            if (joDetails.TryGetValue("wifi", out jt))
            {
                wifi = (int)jt == 1;
            }
            else
            {
                wifi = null;
            }
            if (joDetails.TryGetValue("roomtype", out jt))
            {
                roomtype = (RoomTypeEnum)Enum.Parse(typeof(RoomTypeEnum), (string)jt);
            }
            else
            {
                roomtype = null;
            }
            if (joDetails.TryGetValue("coupon", out jt))
            {
                coupon = (CouponEnum)(int)jt;
            }
            else
            {
                coupon = null;
            }
            if (joDetails.TryGetValue("sort", out jt))
            {
                sort = (SortEnum)(int)jt;
            }
            else
            {
                sort = null;
            }
        }
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            location = joDetails.TryGetValue("location", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            name     = joDetails.TryGetValue("name", out jt) ? (string)jt : null;
            category = joDetails.TryGetValue("category", out jt) ? (string)jt : null;
            special  = joDetails.TryGetValue("special", out jt) ? (string)jt : null;
            price    = joDetails.TryGetValue("price", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            radius   = joDetails.TryGetValue("radius", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            if (joDetails.TryGetValue("coupon", out jt))
            {
                coupon = (CouponEnum)(int)jt;
            }
            else
            {
                coupon = null;
            }
            if (joDetails.TryGetValue("sort", out jt))
            {
                sort = (SortEnum)(int)jt;
            }
            else
            {
                sort = null;
            }
            user_city = joDetails.TryGetValue("user_city", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("user_latitude", out jt))
            {
                user_latitude = float.Parse((string)jt);
            }
            else
            {
                user_latitude = null;
            }
            if (joDetails.TryGetValue("user_longitude", out jt))
            {
                user_longitude = float.Parse((string)jt);
            }
            else
            {
                user_longitude = null;
            }
        }
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            location = joDetails.TryGetValue("location", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            spot     = joDetails.TryGetValue("spot", out jt) ? (string)jt : null;
            datetime = joDetails.TryGetValue("datetime", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            tag      = joDetails.TryGetValue("tag", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("category", out jt))
            {
                category = (TravelCategoryEnum)(int)jt;
            }
            else
            {
                category = null;
            }
        }
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            name     = joDetails.TryGetValue("name", out jt) ? (string)jt : null;
            author   = joDetails.TryGetValue("author", out jt) ? (string)jt : null;
            category = joDetails.TryGetValue("category", out jt) ? (string)jt : null;
            chapter  = joDetails.TryGetValue("chapter", out jt) ? (NumberProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            if (joDetails.TryGetValue("sort", out jt))
            {
                sort = (NovelSortEnum)(int)jt;
            }
            else
            {
                sort = null;
            }
        }
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            datetime   = joDetails.TryGetValue("datetime", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            tv_name    = joDetails.TryGetValue("tv_name", out jt) ? (string)jt : null;
            tv_channel = joDetails.TryGetValue("tv_channel", out jt) ? (string)jt : null;
            show_name  = joDetails.TryGetValue("show_name", out jt) ? (string)jt : null;
            category   = joDetails.TryGetValue("category", out jt) ? (string)jt : null;
        }
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            name     = joDetails.TryGetValue("name", out jt) ? (string)jt : null;
            actor    = joDetails.TryGetValue("actor", out jt) ? (string)jt : null;
            director = joDetails.TryGetValue("director", out jt) ? (string)jt : null;
            tag      = joDetails.TryGetValue("tag", out jt) ? (string)jt : null;
            country  = joDetails.TryGetValue("country", out jt) ? (string)jt : null;
            cinema   = joDetails.TryGetValue("cinema", out jt) ? (string)jt : null;
            location = joDetails.TryGetValue("location", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            datetime = joDetails.TryGetValue("datetime", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            if (joDetails.TryGetValue("coupon", out jt))
            {
                coupon = (CouponEnum)(int)jt;
            }
            else
            {
                coupon = null;
            }
            if (joDetails.TryGetValue("sort", out jt))
            {
                sort = (MovieSortEnum)(int)jt;
            }
            else
            {
                sort = null;
            }
        }
Example #10
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            name = joDetails.TryGetValue("name", out jt) ? (string)jt : null;
            code = joDetails.TryGetValue("code", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("category", out jt))
            {
                category = (StockCategoryEnum)Enum.Parse(typeof(StockCategoryEnum), (string)jt);
            }
            else
            {
                category = null;
            }
            datetime = joDetails.TryGetValue("datetime", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
        }
Example #11
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            start_area = joDetails.TryGetValue("start_area", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            start_loc  = joDetails.TryGetValue("start_loc", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            end_area   = joDetails.TryGetValue("end_area", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            end_loc    = joDetails.TryGetValue("end_loc", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            if (joDetails.TryGetValue("route_type", out jt))
            {
                route_type = (RouteTypeEnum)Enum.Parse(typeof(RouteTypeEnum), (string)jt);
            }
            else
            {
                route_type = null;
            }
            if (joDetails.TryGetValue("bus_num", out jt))
            {
                bus_num = (int)jt;
            }
            else
            {
                bus_num = null;
            }
            subway_num = joDetails.TryGetValue("subway_num", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("type", out jt))
            {
                type = (RouteSortTypeEnum)(int)jt;
            }
            else
            {
                type = null;
            }
            keyword = joDetails.TryGetValue("keyword", out jt) ? (string)jt : null;
        }
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            code       = joDetails.TryGetValue("code", out jt) ? (string)jt : null;
            start_loc  = joDetails.TryGetValue("start_loc", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            end_loc    = joDetails.TryGetValue("end_loc", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            start_date = joDetails.TryGetValue("start_date", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            end_date   = joDetails.TryGetValue("end_date", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            if (joDetails.TryGetValue("seat", out jt))
            {
                seat = (TrainSeatEnum)Enum.Parse(typeof(TrainSeatEnum), (string)jt);
            }
            else
            {
                seat = null;
            }
            if (joDetails.TryGetValue("category", out jt))
            {
                category = (TrainCategoryEnum)Enum.Parse(typeof(TrainCategoryEnum), (string)jt);
            }
            else
            {
                category = null;
            }
            if (joDetails.TryGetValue("type", out jt))
            {
                type = (TrainTypeEnum)Enum.Parse(typeof(TrainTypeEnum), (string)jt);
            }
            else
            {
                type = null;
            }
        }
Example #13
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            flight_no  = joDetails.TryGetValue("flight_no", out jt) ? (string)jt : null;
            start_loc  = joDetails.TryGetValue("start_loc", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            end_loc    = joDetails.TryGetValue("end_loc", out jt) ? (LocationProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            start_date = joDetails.TryGetValue("start_date", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            end_date   = joDetails.TryGetValue("end_date", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            airline    = joDetails.TryGetValue("airline", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("seat", out jt))
            {
                seat = (FlightSeatEnum)Enum.Parse(typeof(FlightSeatEnum), (string)jt);
            }
            else
            {
                seat = null;
            }
            if (joDetails.TryGetValue("sort", out jt))
            {
                sort = (FlightSortEnum)Enum.Parse(typeof(FlightSortEnum), (string)jt);
            }
            else
            {
                sort = null;
            }
        }
Example #14
0
        /// <summary>
        /// 从JObject对象解析
        /// </summary>
        /// <param name="jo"></param>
        public override void Parse(JObject jo)
        {
            base.Parse(jo);
            JObject joDetails = (JObject)jo["details"];
            JToken  jt;

            datetime = joDetails.TryGetValue("datetime", out jt) ? (DateTimeSingleProtocol)CommonProtocol.ParseObject((JObject)jt) : null;
            Event    = joDetails.TryGetValue("event", out jt) ? (string)jt : null;
            if (joDetails.TryGetValue("remind_type", out jt))
            {
                remind_type = (RemindTypeEnum)(int)jt;
            }
            else
            {
                remind_type = null;
            }
        }