void OnClickMailItem(MailVo mv) { if (null != OnClickMailItemHandler) { OnClickMailItemHandler(mv); } }
public int CompareTo(object obj) { MailVo test = (MailVo)obj; if (!this.HasRead && test.HasRead) { return(-1); } else if (this.HasRead && !test.HasRead) { return(1); } else if (MailId > test.MailId) { return(1); } else if (MailId < test.MailId) { return(-1); } else { return(0); } }
void OnClickMailItem(MailVo mailVo) { if (!mailVo.IsComplete) { NetworkManager.Instance.MailDetail(mailVo.MailId, OnDetailHandler); } detailContainer.MailVo = mailVo; SwitchDetailOrList(true); }
MailListItem MakeMailItem(MailVo mailVo) { GameObject go = GameObject.Instantiate(templateMailItem.gameObject) as GameObject; go.transform.parent = mailListScrollPanelGrid.transform; go.transform.localScale = Vector3.one; go.transform.localPosition = templateMailItem.transform.localPosition; go.SetActive(true); MailListItem mailItem = go.GetComponent <MailListItem>(); mailItem.MailVo = mailVo; _mailItemsList.Add(mailItem); return(mailItem); }
void Test() { MailVo[] mailvos = new MailVo[10]; for (int i = 0; i < 10; i++) { MailVo mv = new MailVo(); mv.MailId = UnityEngine.Random.Range(1, int.MaxValue); mv.Title = string.Format("obama send a mail to you {0}", i); mv.Content = "Barack H. Obama is the 44th President of the United States. \n His story is the American story — values from the heartland, a middle-class upbringing in a strong family, hard work and education as the means of getting ahead, and the conviction that a life so blessed should be lived in service to others."; mv.ReceiveTime = System.DateTime.Now; mv.ExpireTime = System.DateTime.Now.Add(new System.TimeSpan(3, 0, 0, 0)); mv.HasRead = i % 3 == 0; mv.Attachments = new List <MailAttachmentVo>(); mv.Attachments.Add(new MailAttachmentVo("all_ring_1_white_1", 2)); mailvos[i] = mv; } AddMails(mailvos); ShowOrHideNoMailsLabel(_mailItemsList.Count == 0); }
void OnDetailHandler(NetResponse response) { if (response.Succeeded) { MailDetailResponse mdResponse = (MailDetailResponse)response; MailVo mv = listContainer.GetItemByMailId(mdResponse.MailId).MailVo; mv.Content = mdResponse.Content; mv.Attachments = mdResponse.Attachments; mv.ReceiveTime = mdResponse.ReceiveTime; mv.HasRead = true; mv.IsComplete = true; if (detailContainer.MailVo.MailId == mdResponse.MailId) { detailContainer.MailVo = mv; } } else { UIMessageBoxManager.Instance.ShowErrorMessageBox(response.errorCode, "Mail"); } }
public override void Decode(BinaryReader reader) { errorCode = reader.ReadInt16(); if (Succeeded) { MaxMailId = reader.ReadInt32(); int num = reader.ReadInt16(); MailVos = new MailVo[num]; for (int i = 0; i < num; i++) { MailVo mv = new MailVo(); mv.MailId = reader.ReadInt32(); mv.Title = ReadString(reader); int status = reader.ReadByte(); mv.HasRead = (status & (1 << 0)) != 0; mv.Collectable = (status & (1 << 1)) != 0; int expireTime = reader.ReadInt32(); mv.ExpireTime = TimeUtils.ConvertFromUnixTimestamp(expireTime); mv.IsComplete = false; MailVos[i] = mv; } } }