当前位置: 首页>>代码示例>>C#>>正文


C# Foundation.BooleanByRef类代码示例

本文整理汇总了C#中Db4objects.Db4o.Foundation.BooleanByRef的典型用法代码示例。如果您正苦于以下问题:C# BooleanByRef类的具体用法?C# BooleanByRef怎么用?C# BooleanByRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BooleanByRef类属于Db4objects.Db4o.Foundation命名空间,在下文中一共展示了BooleanByRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FailingTestSuite

			private FailingTestSuite(bool failOnSetup, bool failOnTeardown, BooleanByRef tearDownCalled
				, IClosure4 tests) : base(tests)
			{
				_failOnSetUp = failOnSetup;
				_failOnTeardown = failOnTeardown;
				_tearDownCalled = tearDownCalled;
			}
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:OpaqueTestSuiteFailureTestCase.cs

示例2: Test

		/// <exception cref="System.Exception"></exception>
		public virtual void Test()
		{
			BooleanByRef disconnected = new BooleanByRef();
			Lock4 Lock = new Lock4();
			if (IsNetworking())
			{
				IDb4oClientServerFixture clientServerFixture = (IDb4oClientServerFixture)Fixture(
					);
				IObjectServerEvents objectServerEvents = (IObjectServerEvents)clientServerFixture
					.Server();
				objectServerEvents.ClientDisconnected += new System.EventHandler<Db4objects.Db4o.Events.StringEventArgs>
					(new _IEventListener4_46(Lock, disconnected).OnEvent);
			}
			DeleteOnDeletingCallbackTestCase.RootItem root = ((DeleteOnDeletingCallbackTestCase.RootItem
				)RetrieveOnlyInstance(typeof(DeleteOnDeletingCallbackTestCase.RootItem)));
			root.child = new DeleteOnDeletingCallbackTestCase.Item();
			Db().Store(root);
			Db().Delete(root);
			Reopen();
			if (IsNetworking())
			{
				Lock.Run(new _IClosure4_63(disconnected, Lock));
			}
			AssertClassIndexIsEmpty();
		}
开发者ID:Galigator,项目名称:db4o,代码行数:26,代码来源:DeleteOnDeletingCallbackTestCase.cs

示例3: AssertSingleEntry

 public virtual void AssertSingleEntry(LocalObjectContainer container, long id)
 {
     var called = new BooleanByRef();
     Index(container).TraverseKeys(container.SystemTransaction(), new _IVisitor4_24(id
         , called));
     Assert.IsTrue(called.value);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:FieldIndexAssert.cs

示例4: _IEventListener4_51

			public _IEventListener4_51(string clientName, BooleanByRef eventRaised, Lock4 Lock
				)
			{
				this.clientName = clientName;
				this.eventRaised = eventRaised;
				this.Lock = Lock;
			}
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:ObjectServerTestCase.cs

示例5: TestExceptionInUpdateCallback

		/// <exception cref="System.Exception"></exception>
		public virtual void TestExceptionInUpdateCallback()
		{
			BooleanByRef doThrow = new BooleanByRef();
			EventRegistryFactory.ForObjectContainer(Db()).Updated += new System.EventHandler<Db4objects.Db4o.Events.ObjectInfoEventArgs>
				(new _IEventListener4_42(doThrow).OnEvent);
			ExceptionsInCallbackTestCase.Holder holder = new ExceptionsInCallbackTestCase.Holder
				();
			ExceptionsInCallbackTestCase.Item item = new ExceptionsInCallbackTestCase.Item();
			Store(holder);
			Store(item);
			Commit();
			doThrow.value = true;
			holder.list = new ArrayList();
			holder.list.Add(item);
			try
			{
				Db().Store(holder, int.MaxValue);
			}
			catch (Exception)
			{
			}
			// rex.printStackTrace();
			Checkdb();
			Commit();
			Checkdb();
			Reopen();
			Checkdb();
		}
开发者ID:erdincay,项目名称:db4o,代码行数:29,代码来源:ExceptionsInCallbackTestCase.cs

示例6: TestExceptionInUpdateCallback

 /// <exception cref="System.Exception"></exception>
 public virtual void TestExceptionInUpdateCallback()
 {
     var doThrow = new BooleanByRef();
     EventRegistryFactory.ForObjectContainer(Db()).Updated += new _IEventListener4_42(doThrow).OnEvent;
     var holder = new Holder
         ();
     var item = new Item();
     Store(holder);
     Store(item);
     Commit();
     doThrow.value = true;
     holder.list = new ArrayList();
     holder.list.Add(item);
     try
     {
         Db().Store(holder, int.MaxValue);
     }
     catch (Exception)
     {
     }
     // rex.printStackTrace();
     Checkdb();
     Commit();
     Checkdb();
     Reopen();
     Checkdb();
 }
开发者ID:masroore,项目名称:db4o,代码行数:28,代码来源:ExceptionsInCallbackTestCase.cs

示例7: TestClientDisconnectedEvent

 // closing is asynchronous, relying on completion is hard
 // That's why there is no test here. 
 // ClientProcessesTestCase tests closing.
 public virtual void TestClientDisconnectedEvent()
 {
     var client = (ClientObjectContainer) OpenClient();
     var clientName = client.UserName;
     var eventRaised = new BooleanByRef();
     var events = (IObjectServerEvents) server;
     var Lock = new Lock4();
     events.ClientDisconnected += new _IEventListener4_51(clientName, eventRaised, Lock).OnEvent;
     Lock.Run(new _IClosure4_58(client, eventRaised, Lock));
 }
开发者ID:masroore,项目名称:db4o,代码行数:13,代码来源:ObjectServerTestCase.cs

示例8: TestSplits

		public virtual void TestSplits()
		{
			BooleanByRef splitNotified = new BooleanByRef();
			IBTreeStructureListener listener = new _IBTreeStructureListener_18(splitNotified);
			_btree.StructureListener(listener);
			for (int i = 0; i < BtreeNodeSize + 1; i++)
			{
				Add(i);
			}
			Assert.IsTrue(splitNotified.value);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:11,代码来源:BTreeStructureChangeListenerTestCase.cs

示例9: TestFailOnTearDown

		public virtual void TestFailOnTearDown()
		{
			BooleanByRef tearDownCalled = new BooleanByRef();
			TestResult result = new TestResult();
			new TestRunner(Iterators.Iterable(new OpaqueTestSuiteFailureTestCase.FailingTestSuite
				[] { new OpaqueTestSuiteFailureTestCase.FailingTestSuite(false, true, tearDownCalled
				) })).Run(result);
			Assert.AreEqual(1, result.TestCount);
			Assert.AreEqual(2, result.Failures.Count);
			Assert.IsTrue(tearDownCalled.value);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:11,代码来源:OpaqueTestSuiteFailureTestCase.cs

示例10: ShareParentForClass

		internal override QConClass ShareParentForClass(IReflectClass a_class, BooleanByRef
			 removeExisting)
		{
			if (i_parent == null)
			{
				return null;
			}
			QConClass newConstraint = new QConClass(i_trans, i_parent, GetField(), a_class);
			Morph(removeExisting, newConstraint, a_class);
			return newConstraint;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:11,代码来源:QConPath.cs

示例11: TestTransactionInEventArgs

 public virtual void TestTransactionInEventArgs()
 {
     var factory = EventRegistryFactory.ForObjectContainer(Db());
     var called = new BooleanByRef();
     var foundTrans = new ObjectByRef();
     factory.Creating += new _IEventListener4_20(called, foundTrans).OnEvent;
     Db().Store(new Item());
     Db().Commit();
     Assert.IsTrue(called.value);
     Assert.AreSame(Trans(), foundTrans.value);
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:EventArgsTransactionTestCase.cs

示例12: TestClientDisconnectedEvent

		// closing is asynchronous, relying on completion is hard
		// That's why there is no test here. 
		// ClientProcessesTestCase tests closing.
		public virtual void TestClientDisconnectedEvent()
		{
			ClientObjectContainer client = (ClientObjectContainer)OpenClient();
			string clientName = client.UserName;
			BooleanByRef eventRaised = new BooleanByRef();
			IObjectServerEvents events = (IObjectServerEvents)server;
			Lock4 Lock = new Lock4();
			events.ClientDisconnected += new System.EventHandler<Db4objects.Db4o.Events.StringEventArgs>
				(new _IEventListener4_51(clientName, eventRaised, Lock).OnEvent);
			Lock.Run(new _IClosure4_58(client, eventRaised, Lock));
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:14,代码来源:ObjectServerTestCase.cs

示例13: TestTransactionInEventArgs

		public virtual void TestTransactionInEventArgs()
		{
			IEventRegistry factory = EventRegistryFactory.ForObjectContainer(Db());
			BooleanByRef called = new BooleanByRef();
			ObjectByRef foundTrans = new ObjectByRef();
			factory.Creating += new System.EventHandler<Db4objects.Db4o.Events.CancellableObjectEventArgs>
				(new _IEventListener4_20(called, foundTrans).OnEvent);
			Db().Store(new EventArgsTransactionTestCase.Item());
			Db().Commit();
			Assert.IsTrue(called.value);
			Assert.AreSame(Trans(), foundTrans.value);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:EventArgsTransactionTestCase.cs

示例14: TestFailOnSetup

 public virtual void TestFailOnSetup()
 {
     var tearDownCalled = new BooleanByRef();
     var result = new TestResult();
     new TestRunner(Iterators.Iterable(new[]
     {
         new FailingTestSuite(true, false, tearDownCalled
             )
     })).Run(result);
     Assert.AreEqual(0, result.TestCount);
     Assert.AreEqual(1, result.Failures.Count);
     Assert.IsFalse(tearDownCalled.value);
 }
开发者ID:masroore,项目名称:db4o,代码行数:13,代码来源:OpaqueTestSuiteFailureTestCase.cs

示例15: Test

		//COR-1839
		#if !SILVERLIGHT
		/// <exception cref="System.Exception"></exception>
		public virtual void Test()
		{
			if (!Platform4.HasWeakReferences())
			{
				return;
			}
			WeakReferenceCollectionTestCase.Item item = new WeakReferenceCollectionTestCase.Item
				();
			Store(item);
			Commit();
			ByRef reference = new ByRef();
			ReferenceSystem().TraverseReferences(new _IVisitor4_30(reference));
			Assert.IsNotNull(((ObjectReference)reference.value));
			item = null;
			long timeout = 10000;
			long startTime = Runtime.CurrentTimeMillis();
			while (true)
			{
				long currentTime = Runtime.CurrentTimeMillis();
				if (currentTime - startTime >= timeout)
				{
					Assert.Fail("Timeout waiting for WeakReference collection.");
				}
				Runtime.Gc();
				Runtime.RunFinalization();
				Thread.Sleep(1);
				if (((ObjectReference)reference.value).GetObject() == null)
				{
					break;
				}
			}
			startTime = Runtime.CurrentTimeMillis();
			while (true)
			{
				long currentTime = Runtime.CurrentTimeMillis();
				if (currentTime - startTime >= timeout)
				{
					Assert.Fail("Timeout waiting for removal of ObjectReference from ReferenceSystem."
						);
				}
				BooleanByRef found = new BooleanByRef();
				ReferenceSystem().TraverseReferences(new _IVisitor4_63(reference, found));
				if (!found.value)
				{
					return;
				}
				Thread.Sleep(10);
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:52,代码来源:WeakReferenceCollectionTestCase.cs


注:本文中的Db4objects.Db4o.Foundation.BooleanByRef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。