|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace www.askbargains.com.ObserverDesignPartternLib
{
public delegate void NotifyObserver(string key);
public abstract class ObservableObject
{
public event NotifyObserver NotifyObserverEvent;
public void AddObserver(NotifyObserver ob)
{
NotifyObserverEvent += ob;
}
public void RemoveObserver(NotifyObserver ob)
{
NotifyObserverEvent -= ob;
}
public void Notify(string kidName)
{
if (NotifyObserverEvent != null)
{
NotifyObserverEvent(kidName);
}
}
}
}
|
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.