You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
582 B
25 lines
582 B
using ConsoleApp1.intf;
|
|
|
|
namespace ConsoleApp1.pubsub
|
|
{
|
|
public abstract class MsgSubscriber : ISubscriber<IMessage>
|
|
{
|
|
public void FireEvent(IMessage message)
|
|
{
|
|
if (message == null)
|
|
{
|
|
return;
|
|
}
|
|
if (String.IsNullOrEmpty(message.Text))
|
|
{
|
|
return;
|
|
}
|
|
string sMsg = $"{DateTime.Now:D} {message.ToString()}";
|
|
message.Text = sMsg;
|
|
ObjFire(message);
|
|
}
|
|
|
|
protected abstract void ObjFire(IMessage sMsg);
|
|
}
|
|
|
|
}
|