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


C# IExtObjectContainer.GetObjectInfo方法代码示例

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


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

示例1: 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

示例2: AssertObjectsAreReadable

		protected override void AssertObjectsAreReadable(IExtObjectContainer objectContainer
			)
		{
			if (Db4oMajorVersion() <= 6 || (Db4oMajorVersion() == 7 && Db4oMinorVersion() == 
				0))
			{
				return;
			}
			CommitTimestampMigrationTestCase.Item item = ((CommitTimestampMigrationTestCase.Item
				)objectContainer.Query(typeof(CommitTimestampMigrationTestCase.Item)).Next());
			IObjectInfo objectInfo = objectContainer.GetObjectInfo(item);
			long version = objectInfo.GetCommitTimestamp();
			Assert.IsGreater(0, version);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:14,代码来源:CommitTimestampMigrationTestCase.cs

示例3: SlotHandlerVersion

		public static int SlotHandlerVersion(IExtObjectContainer objectContainer, object 
			obj)
		{
			int id = (int)objectContainer.GetID(obj);
			IObjectInfo objectInfo = objectContainer.GetObjectInfo(obj);
			ObjectContainerBase container = (ObjectContainerBase)objectContainer;
			Transaction trans = container.Transaction;
			ByteArrayBuffer buffer = container.ReadBufferById(trans, id);
			UnmarshallingContext context = new UnmarshallingContext(trans, (ObjectReference)objectInfo
				, Const4.Transient, false);
			context.Buffer(buffer);
			context.PersistentObject(obj);
			context.ActivationDepth(new LegacyActivationDepth(0));
			context.Read();
			return context.HandlerVersion();
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:16,代码来源:VersionServices.cs


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