public Db4oObject(GenericObject genericObject) { this.genericObject = genericObject; GenericClass genericClass = genericObject.GetGenericClass(); clazz = new Db4oStoredClass(genericClass); IReflectField[] fields = genericClass.GetDeclaredFields(); this.fields = new object[fields.Length]; int index = 0; while (index < fields.Length) { GenericField field = (GenericField) fields[index]; object o = field.Get(genericObject); // object o = genericObject.Get(index); // if (o == null) // { // GenericClass fieldType = (GenericClass) field.GetFieldType(); // o = fieldType.GetName(); // } // else if (o is GenericObject) o = new Db4oObject((GenericObject)o); this.fields[index] = o; index++; } }
public void SetUp() { clazz = new Db4oStoredClass(); }
public Db4oObject(Db4oStoredClass storedClass) : this(new GenericObject(storedClass.GenericClass)) { }