protected void MailResearch_Mail(RicercaMail.MailSelectedEventArgs e) { if (!e.UId.IsNullOrWhiteSpace()) { if (!(WebMailClientManager.CurrentMailExist() && e.UId.Trim() == WebMailClientManager.CurrentMailGet().Uid)) { MailServerConfigFacade mailserveconfigfacade = MailServerConfigFacade.GetInstance(); MailUser account = mailserveconfigfacade.GetUserByUserId(decimal.Parse(e.CurrentAccount)); account.Validated = true; WebMailClientManager.SetAccount(account); int idim = 0; WebMailClientManager.CurrentFolderSet(e.CurrentFolder); WebMailClientManager.ParentFolderSet(e.ParentFolder); if (e.Dimension != string.Empty) { idim = int.Parse(e.Dimension); } if (idim < int.Parse(ConfigurationManager.AppSettings["MaxMemoryDimensionForMailViewer"])) { MailViewer1.Initialize(e.UId, e.CurrRating, e.CurrentFolder, e.ParentFolder); pnlMail.Update(); } else { Message msg = new Message(); msg.Uid = e.UId; msg.Size = idim; WebMailClientManager.CurrentMailSet(msg); MailViewer1.Initialize(e.UId, e.CurrRating, WebMailClientManager.CurrentFolderGet(), WebMailClientManager.ParentFolderGet()); pnlMail.Update(); } } } }
protected void Inbox1_OnRowSelected(object sender, InBox.RowSelectedEventArgs e) { if (!WebMailClientManager.AccountIsValid()) { AccountInvalidated(); } if (!e.UId.IsNullOrWhiteSpace()) { if (!(WebMailClientManager.CurrentMailExist() && e.UId.Trim() == WebMailClientManager.CurrentMailGet().Uid)) { // string folder = e.CurrentFolder.Parse(0); // MailFolder mailFolder = (MailFolder)folder; WebMailClientManager.CurrentFolderSet(e.CurrentFolder); WebMailClientManager.ParentFolderSet(e.ParentFolder); if (e.Dimension < int.Parse(ConfigurationManager.AppSettings["MaxMemoryDimensionForMailViewer"])) { MailViewer1.Initialize(e.UId, e.CurrentRating, e.CurrentFolder, e.ParentFolder); } else { Message msg = new Message(); MailViewer1.hfUIDMailValue = msg.Uid = e.UId; msg.Size = e.Dimension; WebMailClientManager.CurrentMailSet(msg); MailViewer1.Initialize(e.UId, e.CurrentRating, WebMailClientManager.CurrentFolderGet(), WebMailClientManager.ParentFolderGet()); pnlMail.Update(); } } } }