本文整理汇总了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));
}
示例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);
}
示例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();
}