Ejemplo n.º 1
0
        private void UpdateListMail()
        {
            ListMail.DataSource.BeginUpdate();
            ListMail.DataSource.Clear();

            UIWidgets.ObservableList <UListItemMail> dataSource = new UIWidgets.ObservableList <UListItemMail>();

            int nIndex = 1;

            foreach (var baseInfo in LogicDataCenter.mailDataManager.MailBaseInfoList)
            {
                UListItemMail item = new UListItemMail();
                item.nIndex       = nIndex;
                item.nMailID      = baseInfo.nMailID;
                item.nType        = baseInfo.nType;
                item.szTitle      = baseInfo.szTitle;
                item.nIsPlusData  = baseInfo.nIsPlusData;
                item.nSourceType  = baseInfo.nSourceType;
                item.szSenderName = baseInfo.szSenderName;
                item.nSenderPDBID = baseInfo.nSenderPDBID;
                item.nRecvTime    = baseInfo.nRecvTime;
                item.nLifeTime    = baseInfo.nLifeTime;
                item.nReadFlag    = baseInfo.nReadFlag;

                dataSource.Add(item);
                nIndex++;
            }

            ListMail.DataSource = dataSource;
            ListMail.DataSource.EndUpdate();
        }
Ejemplo n.º 2
0
        public void onRecvMailBaseDataList()
        {
            mailContentFrame.Clear();

            ListMail.OnSelect.RemoveListener(onSelectMail);
            ListMail.DataSource.BeginUpdate();
            ListMail.DataSource.Clear();

            UIWidgets.ObservableList <UListItemMail> dataSource = new UIWidgets.ObservableList <UListItemMail>();

            int nIndex = 1;

            foreach (var baseInfo in LogicDataCenter.mailDataManager.MailBaseInfoList)
            {
                UListItemMail item = new UListItemMail();
                item.nIndex       = nIndex;
                item.nMailID      = baseInfo.nMailID;
                item.nType        = baseInfo.nType;
                item.szTitle      = baseInfo.szTitle;
                item.nIsPlusData  = baseInfo.nIsPlusData;
                item.nSourceType  = baseInfo.nSourceType;
                item.szSenderName = baseInfo.szSenderName;
                item.nSenderPDBID = baseInfo.nSenderPDBID;
                item.nRecvTime    = baseInfo.nRecvTime;
                item.nLifeTime    = baseInfo.nLifeTime;
                item.nReadFlag    = baseInfo.nIsRead;

                dataSource.Add(item);
                nIndex++;
            }

            ListMail.DataSource = dataSource;
            ListMail.OnSelect.AddListener(onSelectMail);
            ListMail.DataSource.EndUpdate();

            if (ListMail.DataSource.Count > 0)
            {
                EmptyShowObj.SetActive(false);
                mailContentFrame.gameObject.SetActive(true);
                ListMail.Select(0);
            }
            else
            {
                EmptyShowObj.SetActive(true);
                mailContentFrame.gameObject.SetActive(false);
            }

            //topText.text = String.Format(ULocalizationService.Instance.Get("UIView", "Mail", "TopTextDes"), nTmpCount, m_MailTotalCount);
        }
Ejemplo n.º 3
0
        public void onSelectMail(int index, UIWidgets.ListViewItem item)
        {
            // 选择当前数据
            nCurSelectIndex = index;
            CurSelectItem   = ListMail.DataSource[index];
            ListMail.DataSource[index].nReadFlag = 1;

            if (LogicDataCenter.mailDataManager.MailDetailInfoList.ContainsKey(CurSelectItem.nMailID))
            {
                mailContentFrame.SetMailContentData(CurSelectItem.szTitle, CurSelectItem.szSenderName, LogicDataCenter.mailDataManager.MailDetailInfoList[CurSelectItem.nMailID]);
                return;
            }

            GameLogic.gameview_mail_req_detaildata cmdData = new GameLogic.gameview_mail_req_detaildata();
            cmdData.nMailID = CurSelectItem.nMailID;
            ViewEventHelper.Instance.SendCommand <GameLogic.gameview_mail_req_detaildata>(GameLogicDef.GVIEWCMD_MAIL_REQUESTDETAILDATA, ref cmdData);
        }