Add code examples, and documentation
This commit is contained in:
13
patterns/bridge/Bridge Example/AlertNotification.cs
Normal file
13
patterns/bridge/Bridge Example/AlertNotification.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Bridge_Example;
|
||||
|
||||
//This is one of the refined abstraction classes. Note that it can make use of _sender since it inherits it from its superclass. Note also that since EmailSender and SmsSender implement IMessageSender, their specific SendMessage() method will be called, depending on what's passed into the constructor (see the main method)
|
||||
public class AlertNotification : Notification
|
||||
{
|
||||
public AlertNotification(IMessageSender sender)
|
||||
: base(sender) { }
|
||||
|
||||
public override void Notify(string message)
|
||||
{
|
||||
_sender.SendMessage($"ALERT: {message}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user