private void RefreshAwardDatas() { this.mAwardDatas.Clear(); AwardParam[] allAwards = this.gm.MasterParam.GetAllAwards(); if (allAwards == null || allAwards.Length <= 0) { DebugUtility.LogWarning("AwardList.cs => RefreshAwardDatas():awards is Null or Count 0."); } else { foreach (int num in Enum.GetValues(typeof(AwardParam.Tab))) { AwardParam.Tab key = (AwardParam.Tab)num; if (!this.mAwardDatas.ContainsKey(key)) { this.mAwardDatas.Add(key, new List <AwardParam>()); } } for (int index = 0; index < allAwards.Length; ++index) { AwardParam awardParam = allAwards[index]; if (allAwards != null) { AwardParam.Tab tab = (AwardParam.Tab)awardParam.tab; if (!this.mAwardDatas.ContainsKey(tab)) { this.mAwardDatas.Add(tab, new List <AwardParam>()); } if (tab == AwardParam.Tab.Extra) { if (this.mOpenAwards != null && this.mOpenAwards.Contains(awardParam.iname)) { this.mAwardDatas[tab].Add(awardParam); } } else { this.mAwardDatas[tab].Add(awardParam); } } } this.mAwardDatas[AwardParam.Tab.Normal].Insert(0, this.CreateRemoveAwardData()); if (this.mAwardDatas[AwardParam.Tab.Extra].Count <= 0) { return; } this.mAwardDatas[AwardParam.Tab.Extra].Insert(0, this.CreateRemoveAwardData()); } }
private void TabChange(AwardParam.Tab tab) { this.mPrevTab = this.mCurrentTab; if (this.mPrevTab == tab) { return; } this.mCurrentTab = tab; if (!this.mAwardDatas.ContainsKey(this.mCurrentTab)) { return; } this.mMaxPage = this.mAwardDatas[this.mCurrentTab].Count % this.mMaxViewItems <= 0 ? this.mAwardDatas[this.mCurrentTab].Count / this.mMaxViewItems : this.mAwardDatas[this.mCurrentTab].Count / this.mMaxViewItems + 1; this.mCurrentPage = 0; this.IsRefresh = true; }