public F() { this.classVersion = F.CLASS_VERSION; BB bbAA = new BB(); this.AARef = new AA(bbAA); this.AAARef = new AAA(); BB bbAAA = new BB(); this.AAARef.BBRef = bbAAA; }
protected F(SerializationInfo info, StreamingContext ctxt) { this.classVersion = F.CLASS_VERSION; int persistedClassVersion = (int)info.GetValue("ClassVersionF", typeof(int)); switch (persistedClassVersion) { case 1: // the indirect containment (BB referencing AA) is set automatically by deserialization this.AARef = (AA)info.GetValue("AARef", typeof(AA)); // the indirect containment (BB referencing AAA) is set automatically by deserialization this.AAARef = (AAA)info.GetValue("AAARef", typeof(AAA)); break; } }