void Method() { CSharedBetweenSome sharedSomeInstances = new CSharedBetweenSome(); CChildClass cc = new CChildClass(sharedSomeInstances); COtherChild oc = new COtherChild(sharedSomeInstances); //Set the name property of childclass cc.sharedAllValue = "same name for everyone"; // ALL instance of ChildClass will have this name, ALL instances BOtherChild will be able to acess it sharedSomeInstances.name = "sane name for cc and oc instances"; }
public COtherChild(CSharedBetweenSome sharedSomeInstance) { this.sharedSomeInstance = sharedSomeInstance; }
public CChildClass(CSharedBetweenSome sharedSomeInstance) { this.sharedSomeInstance = sharedSomeInstance; }