• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IExtObjectContainer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AssertArrays

 protected override void AssertArrays(IExtObjectContainer objectContainer, object
     obj)
 {
     var itemArrays = (ItemArrays
         ) obj;
     AssertPrimitiveArray(itemArrays._typedPrimitiveArray);
     if (Db4oHeaderVersion() == VersionServices.Header3040)
     {
     }
     else
     {
         // Bug in the oldest format: It accidentally byte[] arrays to Byte[]
         // arrays.
         if (Db4oHandlerVersion() == 1 && Db4oHeaderVersion() == 100 && itemArrays._primitiveArrayInObject
             == null)
         {
         }
         else
         {
             // do nothing
             // We started treating byte[] in untyped variables differently
             // but we forgot to update the handler version.
             // Concerns only 6.3.500: Updates are not possible.
             AssertPrimitiveArray((byte[]) itemArrays._primitiveArrayInObject);
         }
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:27,代码来源:ByteHandlerUpdateTestCase.cs


示例2: AssertDateTimeQuery

 private void AssertDateTimeQuery(IExtObjectContainer objectContainer, DateTime value)
 {
     IQuery query = objectContainer.Query();
     query.Constrain(typeof (Item));
     query.Descend("_dateTime").Constrain(value);
     Assert.AreEqual(1, query.Execute().Count);
 }
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:IndexedDateTimeUpdateTestCase.cs


示例3: CommitCapturingUpdatedObjects

 private Collection4 CommitCapturingUpdatedObjects(IExtObjectContainer container)
 {
     var updated = new Collection4();
     EventRegistryFor(container).Updated += new _IEventListener4_51(updated).OnEvent;
     container.Commit();
     return updated;
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:TransparentActivationSupportTestCase.cs


示例4: AssertArrays

		protected override void AssertArrays(IExtObjectContainer objectContainer, object 
			obj)
		{
			object[] array = (object[])obj;
			Assert.AreEqual(2, array.Length);
			Assert.AreSame(array[0], array[1]);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:PlainObjectUpdateTestCase.cs


示例5: QueryContains

 private IObjectSet QueryContains(IExtObjectContainer oc, string str)
 {
     var q = oc.Query();
     q.Constrain(typeof (ParameterizedEvaluationTestCase));
     q.Constrain(new MyEvaluation(str));
     return q.Execute();
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:ParameterizedEvaluationTestCase.cs


示例6: Conc

		/// <exception cref="System.Exception"></exception>
		public virtual void Conc(IExtObjectContainer oc)
		{
			IObjectSet os = oc.Query(typeof(InvalidUUIDTestCase));
			if (os.Count == 0)
			{
				// already deleted by other threads
				return;
			}
			Assert.AreEqual(1, os.Count);
			InvalidUUIDTestCase iu = (InvalidUUIDTestCase)os.Next();
			Db4oUUID myUuid = oc.GetObjectInfo(iu).GetUUID();
			Assert.IsNotNull(myUuid);
			byte[] mySignature = myUuid.GetSignaturePart();
			long myLong = myUuid.GetLongPart();
			long unknownLong = long.MaxValue - 100;
			byte[] unknownSignature = new byte[] { 1, 2, 4, 99, 33, 22 };
			Db4oUUID unknownLongPart = new Db4oUUID(unknownLong, mySignature);
			Db4oUUID unknownSignaturePart = new Db4oUUID(myLong, unknownSignature);
			Db4oUUID unknownBoth = new Db4oUUID(unknownLong, unknownSignature);
			Assert.IsNull(oc.GetByUUID(unknownLongPart));
			Assert.IsNull(oc.GetByUUID(unknownSignaturePart));
			Assert.IsNull(oc.GetByUUID(unknownBoth));
			Assert.IsNull(oc.GetByUUID(unknownLongPart));
			Thread.Sleep(500);
			oc.Delete(iu);
			oc.Commit();
			Assert.IsNull(oc.GetByUUID(myUuid));
		}
开发者ID:erdincay,项目名称:db4o,代码行数:29,代码来源:InvalidUUIDTestCase.cs


示例7: Conc1

		/// <exception cref="System.Exception"></exception>
		public virtual void Conc1(IExtObjectContainer oc)
		{
			IObjectSet os = oc.Query(typeof(DualDeleteTestCase.Item));
			Thread.Sleep(500);
			DeleteObjectSet(oc, os);
			oc.Rollback();
		}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:DualDeleteTestCase.cs


示例8: AssertValues

 protected override void AssertValues(IExtObjectContainer objectContainer, object[] values)
 {
     var holder = (HashtableHolder) values[0];
     AssertHashtable(holder._dictionary);
     AssertHashtable(holder._hashtable);
     AssertHashtable(holder._untyped);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:HashtableUpdateTestCase.cs


示例9: Conc

 public virtual void Conc(IExtObjectContainer oc)
 {
     int[] expect = {3, 4, 5};
     var q = oc.Query();
     q.Constrain(typeof (GreaterOrEqualTestCase
         ));
     q.Descend("val").Constrain(3).Greater().Equal();
     var res = q.Execute();
     while (res.HasNext())
     {
         var r = (GreaterOrEqualTestCase
             ) res.Next();
         for (var i = 0; i < expect.Length; i++)
         {
             if (expect[i] == r.val)
             {
                 expect[i] = 0;
             }
         }
     }
     for (var i = 0; i < expect.Length; i++)
     {
         Assert.AreEqual(0, expect[i]);
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:25,代码来源:GreaterOrEqualTestCase.cs


示例10: AssertValues

 // do nothing
 protected override void AssertValues(IExtObjectContainer objectContainer, object[]
     values)
 {
     var item = (Item) values
         [0];
     Assert.AreEqual("one", item._name);
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:EncryptedFileMigrationTestCase.cs


示例11: Update

 protected override void Update(IExtObjectContainer objectContainer)
 {
     var holder = RetrieveHolderInstance(objectContainer);
     UpdateValues(holder._values);
     UpdateArrays(holder._arrays);
     objectContainer.Store(holder, int.MaxValue);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:HandlerUpdateTestCaseBase.cs


示例12: QueryRoot

		private ConcurrentLazyQueriesTestCase.Item QueryRoot(IExtObjectContainer container
			)
		{
			IQuery q = ItemQuery(container);
			q.Descend("id").Constrain(-1);
			return (ConcurrentLazyQueriesTestCase.Item)q.Execute().Next();
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:ConcurrentLazyQueriesTestCase.cs


示例13: AssertObjectsAreUpdated

 protected override void AssertObjectsAreUpdated(IExtObjectContainer objectContainer
     )
 {
     var holder = RetrieveHolderInstance(objectContainer);
     AssertUpdatedValues(holder._values);
     AssertUpdatedArrays(holder._arrays);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:HandlerUpdateTestCaseBase.cs


示例14: QueryRoot

 private Item QueryRoot(IExtObjectContainer container
     )
 {
     var q = ItemQuery(container);
     q.Descend("id").Constrain(-1);
     return (Item) q.Execute().Next();
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:ConcurrentLazyQueriesTestCase.cs


示例15: AssertValues

		// do nothing
		protected override void AssertValues(IExtObjectContainer objectContainer, object[]
			 values)
		{
			EncryptedFileMigrationTestCase.Item item = (EncryptedFileMigrationTestCase.Item)values
				[0];
			Assert.AreEqual("one", item._name);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:EncryptedFileMigrationTestCase.cs


示例16: Conc

		public virtual void Conc(IExtObjectContainer oc)
		{
			int[] expect = new int[] { 3, 4, 5 };
			IQuery q = oc.Query();
			q.Constrain(typeof(Db4objects.Db4o.Tests.Common.Concurrency.GreaterOrEqualTestCase
				));
			q.Descend("val").Constrain(3).Greater().Equal();
			IObjectSet res = q.Execute();
			while (res.HasNext())
			{
				Db4objects.Db4o.Tests.Common.Concurrency.GreaterOrEqualTestCase r = (Db4objects.Db4o.Tests.Common.Concurrency.GreaterOrEqualTestCase
					)res.Next();
				for (int i = 0; i < expect.Length; i++)
				{
					if (expect[i] == r.val)
					{
						expect[i] = 0;
					}
				}
			}
			for (int i = 0; i < expect.Length; i++)
			{
				Assert.AreEqual(0, expect[i]);
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:25,代码来源:GreaterOrEqualTestCase.cs


示例17: Conc

 public virtual void Conc(IExtObjectContainer oc)
 {
     var nr = (NestedArraysTestCase) RetrieveOnlyInstance
         (oc, typeof (NestedArraysTestCase));
     Check((object[]) nr._object, Depth);
     Check(nr._objectArray, Depth);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:NestedArraysTestCase.cs


示例18: ConcReadDifferentObject

		/// <exception cref="System.Exception"></exception>
		public virtual void ConcReadDifferentObject(IExtObjectContainer oc, int seq)
		{
			SimpleObject expected = new SimpleObject(testString + seq, seq);
			IObjectSet result = oc.Query(new ReadObjectNQTestCase.MyPredicate(expected));
			Assert.AreEqual(1, result.Count);
			Assert.AreEqual(expected, result.Next());
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:ReadObjectNQTestCase.cs


示例19: ConcReadDifferentObject

 /// <exception cref="System.Exception"></exception>
 public virtual void ConcReadDifferentObject(IExtObjectContainer oc, int seq)
 {
     var example = new SimpleObject(testString + seq, seq);
     var result = oc.QueryByExample(example);
     Assert.AreEqual(1, result.Count);
     Assert.AreEqual(example, result.Next());
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:ReadObjectQBETestCase.cs


示例20: ConcSetRollback

		public virtual void ConcSetRollback(IExtObjectContainer oc, int seq)
		{
			if (seq % 2 == 0)
			{
				// if the thread sequence is even, store something
				for (int i = 0; i < 1000; i++)
				{
					SimpleObject c = new SimpleObject("oc " + i, i);
					oc.Store(c);
				}
			}
			else
			{
				// if the thread sequence is odd, rollback
				for (int i = 0; i < 1000; i++)
				{
					SimpleObject c = new SimpleObject("oc " + i, i);
					oc.Store(c);
					oc.Rollback();
					c = new SimpleObject("oc2.2 " + i, i);
					oc.Store(c);
				}
				oc.Rollback();
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:25,代码来源:SetRollbackTestCase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IExtenderProvider类代码示例发布时间:2022-05-24
下一篇:
C# IExpressionViewModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap