public void UnsubscribeFromInformation(InformationSender unsubscriber, string reason) { InformationEvent -= unsubscriber; Complaints.Add(reason); }
// 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); }
public void UnsubscribeForInfo(InformationSender subscriber, string reason) { InformationHandler -= subscriber; ZalbiIPoplaki.Add(reason); }