public void MailReceived(Plic plic) { if (plic.Numar.HasValue && plic.Strada != null) { mailWithAddress.Add(plic); if (null != PlicWithAddress) { PlicWithAddress(this, plic.Id); } } else { mailWithoutAddress.Add(plic); if (null != PlicWithoutAddress) { PlicWithoutAddress(this, plic.Id); } } }
public void Generate() { for (int i = 0; i < 100; i++) { Plic plic = new Plic(); plic.Id = i; if (i < 80) { plic.Numar = i; plic.Strada = String.Format("Strada {0}", i); } else { plic.Strada = String.Format("Strada {0}", i); } if (null != MailReceived) { MailReceived(this, plic); } } }
private static void MailRoom_MailReceived(object sender, Plic e) { boyWhoSorts.MailReceived(e); //mailRoom.MailReceiveExtension(e); }