本文整理汇总了C#中Db4objects.Db4o.Foundation.Collection4.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# Collection4.GetEnumerator方法的具体用法?C# Collection4.GetEnumerator怎么用?C# Collection4.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Foundation.Collection4
的用法示例。
在下文中一共展示了Collection4.GetEnumerator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteAndReadd
private void DeleteAndReadd(IObjectContainer db, Collection4 removed)
{
var removeIter = removed.GetEnumerator();
while (removeIter.MoveNext())
{
db.Delete(removeIter.Current);
}
db.Commit();
var readdIter = removed.GetEnumerator();
while (readdIter.MoveNext())
{
db.Store(readdIter.Current);
}
db.Commit();
}
示例2: NewIterator
private CompositeIterator4 NewIterator()
{
Collection4 iterators = new Collection4();
iterators.Add(IntArrays4.NewIterator(new int[] { 1, 2, 3 }));
iterators.Add(IntArrays4.NewIterator(new int[] { }));
iterators.Add(IntArrays4.NewIterator(new int[] { 4 }));
iterators.Add(IntArrays4.NewIterator(new int[] { 5, 6 }));
CompositeIterator4 iterator = new CompositeIterator4(iterators.GetEnumerator());
return iterator;
}
示例3: TestSeries
public virtual void TestSeries()
{
Collection4 calls = new Collection4();
IEnumerator series = Iterators.Series(string.Empty, new _IFunction4_11(calls)).GetEnumerator
();
Assert.IsTrue(series.MoveNext());
Assert.IsTrue(series.MoveNext());
Iterator4Assert.AreEqual(new object[] { string.Empty, "*" }, calls.GetEnumerator(
));
}
示例4: TraverseMutable
public virtual void TraverseMutable(IVisitor4 visitor)
{
Collection4 currentContent = new Collection4();
TraverseLocked(new _IVisitor4_51(currentContent));
IEnumerator i = currentContent.GetEnumerator();
while (i.MoveNext())
{
visitor.Visit(i.Current);
}
}
示例5: Run
public virtual void Run()
{
dontRemove = true;
Collection4 copy = new Collection4(_containers);
IEnumerator i = copy.GetEnumerator();
while (i.MoveNext())
{
((ObjectContainerBase)i.Current).ShutdownHook();
}
}
示例6: IteratorFor
public virtual IEnumerator IteratorFor(object collection)
{
IDictionary map = (IDictionary)collection;
Collection4 result = new Collection4();
IEnumerator it = map.GetEnumerator();
while (it.MoveNext())
{
DictionaryEntry entry = (DictionaryEntry)it.Current;
result.Add(entry.Key);
result.Add(entry.Value);
}
return result.GetEnumerator();
}
示例7: TestClose
/// <exception cref="System.Exception"></exception>
public virtual void TestClose()
{
var container = Db();
var session = FileSession();
var actual = new Collection4();
EventRegistry().Closing += new _IEventListener4_21(actual).OnEvent;
Fixture().Close();
if (IsEmbedded())
{
Iterator4Assert.AreEqual(new object[] {container, session}, actual.GetEnumerator
());
}
else
{
Assert.AreSame(container, actual.SingleElement());
}
}
示例8: TestClose
/// <exception cref="System.Exception"></exception>
public virtual void TestClose()
{
IExtObjectContainer container = Db();
LocalObjectContainer session = FileSession();
Collection4 actual = new Collection4();
EventRegistry().Closing += new System.EventHandler<Db4objects.Db4o.Events.ObjectContainerEventArgs>
(new _IEventListener4_21(actual).OnEvent);
Fixture().Close();
if (IsEmbedded())
{
Iterator4Assert.AreEqual(new object[] { container, session }, actual.GetEnumerator
());
}
else
{
Assert.AreSame(container, actual.SingleElement());
}
}
示例9: WriteAllClasses
public void WriteAllClasses()
{
Collection4 deadClasses = new Collection4();
IStoredClass[] storedClasses = StoredClasses();
for (int i = 0; i < storedClasses.Length; i++)
{
ClassMetadata clazz = (ClassMetadata)storedClasses[i];
clazz.SetStateDirty();
if (clazz.StateDead())
{
deadClasses.Add(clazz);
clazz.SetStateOK();
}
}
for (int i = 0; i < storedClasses.Length; i++)
{
ClassMetadata clazz = (ClassMetadata)storedClasses[i];
clazz.Write(_systemTransaction);
}
IEnumerator it = deadClasses.GetEnumerator();
while (it.MoveNext())
{
((ClassMetadata)it.Current).SetStateDead();
}
}
示例10: ClassIDIterator
public ClassIDIterator(Collection4 classes) : base(classes.GetEnumerator())
{
}
示例11: EnsureAllClassesRead
private void EnsureAllClassesRead()
{
bool allClassesRead = false;
while (!allClassesRead)
{
Collection4 unreadClasses = new Collection4();
int numClasses = _classes.Size();
IEnumerator classIter = _classes.GetEnumerator();
while (classIter.MoveNext())
{
ClassMetadata clazz = (ClassMetadata)classIter.Current;
if (clazz.StateUnread())
{
unreadClasses.Add(clazz);
}
}
IEnumerator unreadIter = unreadClasses.GetEnumerator();
while (unreadIter.MoveNext())
{
ClassMetadata clazz = (ClassMetadata)unreadIter.Current;
clazz = ReadClassMetadata(clazz, null);
if (clazz.ClassReflector() == null)
{
clazz.ForceRead();
}
}
allClassesRead = (_classes.Size() == numClasses);
}
ApplyReadAs();
}
示例12: AspectByName
private ClassAspect AspectByName(Collection4 aspects, string aspectName)
{
var i = aspects.GetEnumerator();
while (i.MoveNext())
{
var current = (ClassAspect) i.Current;
if (current.GetName().Equals(aspectName))
{
return current;
}
}
return null;
}
示例13: AssertAllSlotsFreed
/// <exception cref="System.Exception"></exception>
public static void AssertAllSlotsFreed(LocalTransaction trans, BTree bTree, ICodeBlock
block)
{
LocalObjectContainer container = (LocalObjectContainer)trans.Container();
ITransactionalIdSystem idSystem = trans.IdSystem();
IEnumerator allSlotIDs = bTree.AllNodeIds(trans.SystemTransaction());
Collection4 allSlots = new Collection4();
while (allSlotIDs.MoveNext())
{
int slotID = ((int)allSlotIDs.Current);
Slot slot = idSystem.CurrentSlot(slotID);
allSlots.Add(slot);
}
Slot bTreeSlot = idSystem.CurrentSlot(bTree.GetID());
allSlots.Add(bTreeSlot);
Collection4 freedSlots = new Collection4();
IFreespaceManager freespaceManager = container.FreespaceManager();
container.InstallDebugFreespaceManager(new FreespaceManagerForDebug(new _ISlotListener_99
(freedSlots)));
block.Run();
container.InstallDebugFreespaceManager(freespaceManager);
Assert.IsTrue(freedSlots.ContainsAll(allSlots.GetEnumerator()));
}
示例14: Iterate
public static IEnumerator Iterate(List4 list)
{
if (list == null)
{
return EmptyIterator;
}
Collection4 collection = new Collection4();
while (list != null)
{
collection.Add(list._element);
list = ((List4)list._next);
}
return collection.GetEnumerator();
}
示例15: IterateJoins
internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon ProduceTopLevelJoin
()
{
if (!HasJoins())
{
return this;
}
IEnumerator i = IterateJoins();
if (i_joins.Size() == 1)
{
i.MoveNext();
return ((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).ProduceTopLevelJoin
();
}
Collection4 col = new Collection4();
while (i.MoveNext())
{
col.Ensure(((Db4objects.Db4o.Internal.Query.Processor.QCon)i.Current).ProduceTopLevelJoin
());
}
i = col.GetEnumerator();
i.MoveNext();
Db4objects.Db4o.Internal.Query.Processor.QCon qcon = (Db4objects.Db4o.Internal.Query.Processor.QCon
)i.Current;
if (col.Size() == 1)
{
return qcon;
}
while (i.MoveNext())
{
qcon = (Db4objects.Db4o.Internal.Query.Processor.QCon)qcon.And((IConstraint)i.Current
);
}
return qcon;
}