/// <summary> /// Set server to email list view. /// </summary> /// <param name="_server">_server.</param> public void SetServer(Server _server) { // Servers ActiveServer = _server; // Clear items EmailItems.Clear(); // Clear list content EmailListContent.Clear(); // Add all emails from Server int x = 0; foreach (Email i in ActiveServer.Emails) { var tmp = new EmailListItem(this, i, (x % 2 == 0) ? Colors.White : Colors.LightGray); if (!Email.IsValid(i.UserEmail)) { tmp.BackgroundColor = Colors.Red; } EmailListContent.PackStart(tmp); EmailItems.Add(tmp); x++; } }
/// <summary> /// Add new email to email list in server & create email list box. /// </summary> private void NewEmail_Clicked(object sender, EventArgs e) { var _new = new Email(); ActiveServer.Emails.Add(_new); int size = ActiveServer.Emails.Count + 1; var tmp = new EmailListItem(this, _new, (size % 2 == 0) ? Colors.White : Colors.LightGray) { BackgroundColor = Colors.Red }; EmailItems.Add(tmp); EmailListContent.PackStart(tmp); }
/// <summary> /// Add new email to email list in server & create email list box. /// </summary> private void NewEmail_Clicked(object sender, EventArgs e) { var _new = new Email(); ActiveServer.Emails.Add(_new); int size = ActiveServer.Emails.Count + 1; var tmp = new EmailListItem(this, _new, (size%2 == 0) ? Colors.White : Colors.LightGray) { BackgroundColor = Colors.Red }; EmailItems.Add(tmp); EmailListContent.PackStart(tmp); }
/// <summary> /// Set server to email list view. /// </summary> /// <param name="_server">_server.</param> public void SetServer(Server _server) { // Servers ActiveServer = _server; // Clear items EmailItems.Clear(); // Clear list content EmailListContent.Clear(); // Add all emails from Server int x = 0; foreach (Email i in ActiveServer.Emails) { var tmp = new EmailListItem(this, i, (x%2 == 0) ? Colors.White : Colors.LightGray); if (!Email.IsValid(i.UserEmail)) { tmp.BackgroundColor = Colors.Red; } EmailListContent.PackStart(tmp); EmailItems.Add(tmp); x++; } }