// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections; class MainClass { public static void Main(string[] args) { Parent p = new Parent(); p.addChild(new Child()); } } class Parent { private ArrayList cs; public Parent() { cs = new ArrayList(); } public void addChild(Child c) { cs.Add(c); c.P = this; } } class Child { private Parent p; public Child() { p = null; } public Parent P { set { p = value; } get { return p; } } }