Example #1
0
 void mm_NewMail(object sender, NewMailEventArgs e)
 {
     Console.WriteLine("From: {0}, To: {1}, Subject: {2}",
                       e.From,
                       e.To,
                       e.Subject);
 }
Example #2
0
        //Create a method responsible for raising the event.
        //It should not called from outside.
        //Also marked virtual for derived class to override it.
        protected virtual void OnNewMail(NewMailEventArgs args)
        {
            var temp = NewMail;

            if (temp != null)
            {
                temp(this, args);
            }
        }
Example #3
0
 //Don't do anything. Don't want to inform anyone on new email.
 protected override void OnNewMail(NewMailEventArgs args)
 {
     Console.WriteLine("Top Secret. Can't disclose.");
 }