public FestivalInfo() : base(AccessLevel.ReadWrite) { Reward = new CacheList <PrizeInfo>(); TimePriod = new TimePriod(); TaskConfig = new CacheList <TaskConfigInfo>(); FestivalExtend = new FestivalExtend(); }
protected override object this[string index] { get { #region switch (index) { case "FestivalID": return(FestivalID); case "FestivalName": return(FestivalName); case "StartDate": return(StartDate); case "ContinuedTime": return(ContinuedTime); case "RestrainNum": return(RestrainNum); case "Reward": return(Reward); case "IsStop": return(IsStop); case "FestivalDesc": return(FestivalDesc); case "TimePriod": return(TimePriod); case "TaskConfig": return(TaskConfig); case "FestivalExtend": return(FestivalExtend); case "EndDate": return(EndDate); case "FestivalType": return(FestivalType); case "HeadID": return(HeadID); default: throw new ArgumentException(string.Format("FestivalInfo index[{0}] isn't exist.", index)); } #endregion } set { #region switch (index) { case "FestivalID": _FestivalID = value.ToInt(); break; case "FestivalName": _FestivalName = value.ToNotNullString(); break; case "StartDate": _StartDate = value.ToDateTime(); break; case "ContinuedTime": _ContinuedTime = value.ToInt(); break; case "RestrainNum": _RestrainNum = value.ToInt(); break; case "Reward": _Reward = ConvertCustomField <CacheList <PrizeInfo> >(value, index); break; case "IsStop": _IsStop = value.ToBool(); break; case "FestivalDesc": _FestivalDesc = value.ToNotNullString(); break; case "TimePriod": _TimePriod = ConvertCustomField <TimePriod>(value, index); // ?? new TimePriod(); break; case "TaskConfig": _TaskConfig = ConvertCustomField <CacheList <TaskConfigInfo> >(value, index); break; case "FestivalExtend": _FestivalExtend = ConvertCustomField <FestivalExtend>(value, index); break; case "EndDate": _EndDate = value.ToDateTime(); break; case "FestivalType": _FestivalType = value.ToEnum <FestivalType>(); break; case "HeadID": _HeadID = value.ToNotNullString(); break; default: throw new ArgumentException(string.Format("FestivalInfo index[{0}] isn't exist.", index)); } #endregion } }