public void Dispose() { if (_container == null) { return; } IEventRegistry r = EventRegistryFactory.ForObjectContainer(_container); r.Activated -= OnActivated; _container = null; _singleton = null; }
public static void Initialize(IObjectContainer container) { Debug.Assert(container != null); if (_singleton != null && container == _singleton._container) { return; } //exists, but some test is opening a different container if (_singleton != null) { _singleton.Dispose(); _singleton = null; } if (_singleton == null) { _singleton = new Db4oLexModelHelper(container); } }
public static void Deinitialize(IObjectContainer container) { Debug.Assert(_singleton._container == container); _singleton.Dispose(); _singleton = null; }
public static void InitializeForNonDbTests() { _singleton = new Db4oLexModelHelper(null); }