Skip to content

Instantly share code, notes, and snippets.

@kashifmunir
kashifmunir / ObserverPatternC#.cs
Created June 24, 2013 14:25
Observer Pattern Example C#
/// <summary>
/// Observer class
/// </summary>
abstract class Observer
{
public abstract void notify(string eventName, object eventValue);
}
/// <summary>
/// Observable class
@kashifmunir
kashifmunir / DecoratorPattern.cs
Created May 15, 2013 11:43
Decorator Pattern Example in C#
abstract class WindowAbstract
{
/// <summary>
/// a dictionary that will store all method names and their delegate/function pointer information
/// </summary>
protected Dictionary<string, Delegate> callbacks = new Dictionary<string, Delegate>();
/// <summary>
/// Dynamically execute a function from the Dictionary/Array of callbacks
/// </summary>