コード例 #1
0
 public void UnsubscribeFromInformation(InformationSender unsubscriber, string reason)
 {
     InformationEvent -= unsubscriber;
     Complaints.Add(reason);
 }
コード例 #2
0
 // A method that accepts a subscriber method that must follow the InformationSender delegate
 // It also takes the email of the subscriber
 // This subscriber expects to get only relevant information each time the market sends one
 // This is used just as an example that we can have multiple events with different delegates for different business logic
 public void SubscribeForInformation(InformationSender subscriber, string email)
 {
     Information += subscriber;
     Emails.Add(email);
 }
コード例 #3
0
 public void UnsubscribeForInfo(InformationSender subscriber, string reason)
 {
     InformationHandler -= subscriber;
     ZalbiIPoplaki.Add(reason);
 }