Esempio n. 1
0
        public void SimulateMailArrived(string from, string to, string subj, string body)
        {
            MailEventArgs args = new MailEventArgs()
            {
                Body    = body,
                From    = from,
                Subject = subj,
                To      = to
            };

            MailArrived?.Invoke(this, args);

            /*
             * EQUIVALENTE A :
             * if (MailArrived !=null)
             * {
             *  MailArrived(this, args);
             *  /*EQUIVALENTE A
             *  foreach (var item in MailArrived.GetInvocationList().ToList())
             *  {
             *      MailEventHandler mm_eh = (MailEventHandler)item;
             *      mm_eh(this, args);
             *  }
             *
             * }
             */
        }
Esempio n. 2
0
 protected virtual void OnMailArrived(Object sender, MailArrivedEventArgs e)
 {
     if (MailArrived != null)
     {
         MailArrived.Invoke(sender, e);
     }
 }
Esempio n. 3
0
 protected virtual void OnMailArrived(MailArrivedEventArgs args)
 {
     MailArrived?.Invoke(this, args);
 }
Esempio n. 4
0
 protected virtual void OnMailArrived(MailArrivedEventArgs e)
 {
     //Awesome.
     MailArrived?.Invoke(this, e);
 }