static void Main(string[] args) { Element a = new Element("a", null); Element b = new Element("b", a); Element c = new Element("c", b); Element d = new Element("d", a); a.Click += (sender, e) => { Console.WriteLine("event arrived in a"); }; }
public Element(string name, Element parent) { this.name = name; this.parent = parent; }