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
497 B
25 lines
497 B
|
10 months ago
|
using ConsoleApp1.intf;
|
||
|
|
|
||
|
|
namespace ConsoleApp1.pubsub.generics
|
||
|
|
{
|
||
|
|
|
||
|
|
public abstract class Subscriber<T> : ISubscriber<T>
|
||
|
|
where T : IMessage
|
||
|
|
{
|
||
|
|
public void FireEvent(T message)
|
||
|
|
{
|
||
|
|
if (message == null)
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (string.IsNullOrEmpty(message.Text))
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
ObjFire(message);
|
||
|
|
}
|
||
|
|
|
||
|
|
protected abstract void ObjFire(T sMsg);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|