Exemplo n.º 1
0
        public void Init()
        {
            List <NetSelectHNScrollController.ScrollData> source = new List <NetSelectHNScrollController.ScrollData>();

            foreach (KeyValuePair <int, NetworkInfo.UserInfo> keyValuePair in this.netInfo.dictUserInfo)
            {
                KeyValuePair <int, NetworkInfo.UserInfo> n = keyValuePair;
                int num = this.netInfo.lstCharaInfo.Where <NetworkInfo.CharaInfo>((Func <NetworkInfo.CharaInfo, bool>)(x => x.user_idx == n.Key)).ToArray <NetworkInfo.CharaInfo>().Length + this.netInfo.lstHousingInfo.Where <NetworkInfo.HousingInfo>((Func <NetworkInfo.HousingInfo, bool>)(x => x.user_idx == n.Key)).ToArray <NetworkInfo.HousingInfo>().Length;
                if (num != 0)
                {
                    source.Add(new NetSelectHNScrollController.ScrollData()
                    {
                        info =
                        {
                            userIdx    = n.Key,
                            drawname   = TextCorrectLimit.CorrectString(this.text, string.Format("({0}) {1}", (object)num, (object)n.Value.handleName), "…"),
                            handlename = n.Value.handleName
                        }
                    });
                }
            }
            using (new GameSystem.CultureScope())
                source = source.OrderBy <NetSelectHNScrollController.ScrollData, string>((Func <NetSelectHNScrollController.ScrollData, string>)(n => n.info.handlename)).ToList <NetSelectHNScrollController.ScrollData>();
            this.scrollerDatas = source.ToArray();
            int num1 = !((IList <NetSelectHNScrollController.ScrollData>) this.scrollerDatas).IsNullOrEmpty <NetSelectHNScrollController.ScrollData>() ? this.scrollerDatas.Length / this.countPerRow : 0;

            if (!((IList <NetSelectHNScrollController.ScrollData>) this.scrollerDatas).IsNullOrEmpty <NetSelectHNScrollController.ScrollData>() && this.scrollerDatas.Length % this.countPerRow > 0)
            {
                ++num1;
            }
            if (!this.view.IsInit)
            {
                this.view.InitListView(num1, new Func <LoopListView2, int, LoopListViewItem2>(this.OnUpdate), (LoopListViewInitParam)null);
            }
            else
            {
                if (this.view.SetListItemCount(num1, true))
                {
                    return;
                }
                this.view.RefreshAllShownItem();
            }
        }
Exemplo n.º 2
0
 public static void Correct(Text text, string baseStr, string endStr)
 {
     text.set_text(TextCorrectLimit.CorrectString(text, baseStr, endStr));
 }