|
using System;
using System.Collections.Generic;
using System.Text;
namespace DCAF.BusinessLayer
{
public abstract class Publisher : IEventPublisher
{
private delegate void m_eventHandler(IEventPublisher p_publisher);
private event m_eventHandler m_event;
#region "IEventPublisher Implementation"
public void RegisterListener<T>(T p_listener) where T : IEventListener
{
m_event += new m_eventHandler(p_listener.OnNotification);
}
public void UnregisterListener<T>(T p_listener) where T : IEventListener
{
m_event -= new m_eventHandler(p_listener.OnNotification);
}
public void NotifyListeners()
{
if (m_event != null)
m_event(this);
}
protected bool m_isDirty = false;
public bool IsDirty
{
get { return m_isDirty; }
set { m_isDirty = value; }
}
protected bool m_initializing = true;
public bool Initializing
{
get { return m_initializing; }
set { m_initializing = value; }
}
protected bool m_isNew = false;
public bool IsNew
{
get { return m_isNew; }
set { m_isNew = true; }
}
#endregion "IEventPublisher Implementation"
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Working in the IT-Branch for more then 10 years now. Starting as a programmer in WinDev, moved to Progress and actualy working in .NET since 2003. At the moment i'm employed as a .NET architect and teamleader at BERCO N.V. at Ronse (Belgium). In my spare time, i'm a die hard mountainbiker and together with my son Jarne, we're climbing the hills in the "Flemish Ardens" and the wonderfull "Pays des Collines". I also enjoy "a p'tit Jack" (Jack Daniels Whiskey) or a "Duvel" (beer) for "l'après VTT !".