本文整理汇总了C#中IExtObjectContainer类的典型用法代码示例。如果您正苦于以下问题:C# IExtObjectContainer类的具体用法?C# IExtObjectContainer怎么用?C# IExtObjectContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IExtObjectContainer类属于命名空间,在下文中一共展示了IExtObjectContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例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);
}
示例3: CommitCapturingUpdatedObjects
private Collection4 CommitCapturingUpdatedObjects(IExtObjectContainer container)
{
var updated = new Collection4();
EventRegistryFor(container).Updated += new _IEventListener4_51(updated).OnEvent;
container.Commit();
return updated;
}
示例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]);
}
示例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();
}
示例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));
}
示例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();
}
示例8: AssertValues
protected override void AssertValues(IExtObjectContainer objectContainer, object[] values)
{
var holder = (HashtableHolder) values[0];
AssertHashtable(holder._dictionary);
AssertHashtable(holder._hashtable);
AssertHashtable(holder._untyped);
}
示例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]);
}
}
示例10: AssertValues
// do nothing
protected override void AssertValues(IExtObjectContainer objectContainer, object[]
values)
{
var item = (Item) values
[0];
Assert.AreEqual("one", item._name);
}
示例11: Update
protected override void Update(IExtObjectContainer objectContainer)
{
var holder = RetrieveHolderInstance(objectContainer);
UpdateValues(holder._values);
UpdateArrays(holder._arrays);
objectContainer.Store(holder, int.MaxValue);
}
示例12: QueryRoot
private ConcurrentLazyQueriesTestCase.Item QueryRoot(IExtObjectContainer container
)
{
IQuery q = ItemQuery(container);
q.Descend("id").Constrain(-1);
return (ConcurrentLazyQueriesTestCase.Item)q.Execute().Next();
}
示例13: AssertObjectsAreUpdated
protected override void AssertObjectsAreUpdated(IExtObjectContainer objectContainer
)
{
var holder = RetrieveHolderInstance(objectContainer);
AssertUpdatedValues(holder._values);
AssertUpdatedArrays(holder._arrays);
}
示例14: QueryRoot
private Item QueryRoot(IExtObjectContainer container
)
{
var q = ItemQuery(container);
q.Descend("id").Constrain(-1);
return (Item) q.Execute().Next();
}
示例15: AssertValues
// do nothing
protected override void AssertValues(IExtObjectContainer objectContainer, object[]
values)
{
EncryptedFileMigrationTestCase.Item item = (EncryptedFileMigrationTestCase.Item)values
[0];
Assert.AreEqual("one", item._name);
}