public override void OnExit() { MtaManager.TrackEndPage(MtaType.EmailDetailWindow); mailMsgInfo = null; Utils.DestoryChildren(attachItems); MailHandler.MailIsUpdated -= OnMailUpdate; }
public void Init(MailMsgInfo info) { mailMsgInfo = info; if (mailMsgInfo != null) { var hasAttachment = mailMsgInfo.Attachments != null && mailMsgInfo.Attachments.Count > 0; if (hasAttachment) { MailConstant.ShowAttachments(mailMsgInfo.Attachments, mailItems.transform, 0); mailItems.repositionNow = true; } } }
public void Init(MailMsgInfo mailMsgInfo) { MailMsgInfo = mailMsgInfo; if (MailMsgInfo != null) { senderLabel.text = MailMsgInfo.Sender; timeLabel.text = Utils.ConvertFromJavaTimestamp(MailMsgInfo.CreateTime).ToString("yyyy-M-d"); titleLabel.text = Utils.SubstringWithinByteLimit(MailMsgInfo.Title, MailConstant.MailByteCutLength, CutSymbol); var desc = GetAttachDesc(MailMsgInfo.Attachments); attachLabel.text = Utils.SubstringWithinByteLimit(desc, MailConstant.MailByteCutLength, CutSymbol); DateTime expireTime = Utils.ConvertFromJavaTimestamp(MailMsgInfo.Deadline); TimeRemain = expireTime.Subtract(DateTime.Now); var hasAttachment = (MailMsgInfo.Attachments != null && MailMsgInfo.Attachments.Count > 0); NGUITools.SetActive(receiveLis.gameObject, hasAttachment); MailState = (MailConstant.MailState)MailMsgInfo.State; } }
public void Init(int mailId, string txt) { Content = txt; mailMsgInfo = MailModelLocator.Instance.FindMailViaMailId(mailId); if(mailMsgInfo != null) { senderLabel.text = mailMsgInfo.Sender; titleLabel.text = mailMsgInfo.Title; timeLabel.text = Utils.ConvertFromJavaTimestamp(mailMsgInfo.CreateTime).ToString("yyyy-M-d"); var hasAttachment = mailMsgInfo.Attachments != null && mailMsgInfo.Attachments.Count > 0; var gain = (MailConstant.MailState) mailMsgInfo.State == MailConstant.MailState.Gain; NGUITools.SetActive(attachment.gameObject, hasAttachment); NGUITools.SetActive(decorate.gameObject, hasAttachment); NGUITools.SetActive(received.gameObject, gain); NGUITools.SetActive(receiveLis.gameObject, !gain); if (hasAttachment && !gain) { MailConstant.ShowAttachments(mailMsgInfo.Attachments, attachItems, Interval); } } }
public override void OnExit() { mailMsgInfo = null; Utils.DestoryChildren(mailItems.transform); MailHandler.MailIsUpdated -= OnMailUpdate; }