Example #1
0
		public void Dispose()
		{
			if (_container == null)
			{
				return;
			}

			IEventRegistry r =
					EventRegistryFactory.ForObjectContainer(_container);
			r.Activated -= OnActivated;
			_container = null;
			_singleton = null;
		}
Example #2
0
		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);
			}
		}
Example #3
0
		public static void Deinitialize(IObjectContainer container)
		{
			Debug.Assert(_singleton._container == container);
			_singleton.Dispose();
			_singleton = null;
		}
Example #4
0
		public static void InitializeForNonDbTests()
		{
			_singleton = new Db4oLexModelHelper(null);
		}