ExtObjectContainer.isActive method provides you with means to define if the object is active.
01public static void CheckActive() 02
{ 03
StoreSensorPanel(); 04
IConfiguration configuration = Db4oFactory.NewConfiguration(); 05
configuration.ActivationDepth(2); 06
IObjectContainer db = Db4oFactory.OpenFile(configuration, Db4oFileName); 07
try 08
{ 09
System.Console.WriteLine("Object container activation depth = 2"); 10
IObjectSet result = db.Get(new SensorPanel(1)); 11
SensorPanel sensor = (SensorPanel)result[0]; 12
SensorPanel next = sensor.Next; 13
while (next != null) 14
{ 15
System.Console.WriteLine("Object " + next +" is active: " + db.Ext().IsActive(next)); 16
next = next.Next; 17
} 18
} 19
finally 20
{ 21
db.Close(); 22
} 23
}
01Public Shared Sub CheckActive() 02
StoreSensorPanel() 03
Dim configuration As IConfiguration = Db4oFactory.NewConfiguration() 04
configuration.ActivationDepth(2) 05
Dim db As IObjectContainer = Db4oFactory.OpenFile(configuration, Db4oFileName) 06
Try 07
System.Console.WriteLine("Object container activation depth = 2") 08
Dim result As IObjectSet = db.Get(New SensorPanel(1)) 09
Dim sensor As SensorPanel = CType(result(0), SensorPanel) 10
Dim NextSensor As SensorPanel = sensor.NextSensor 11
While Not NextSensor Is Nothing 12
System.Console.WriteLine("Object " + NextSensor.ToString() + " is active: " + db.Ext().IsActive(NextSensor).ToString()) 13
NextSensor = NextSensor.NextSensor 14
End While 15
Finally 16
db.Close() 17
End Try 18
End Sub
This method can be useful in applications with deep object hierarchy if you prefer to use manual activation.