progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
49
AspClassic.Scripting/Utils/DictionaryUnionEnumerator.cs
Normal file
49
AspClassic.Scripting/Utils/DictionaryUnionEnumerator.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Scripting.Utils;
|
||||
|
||||
internal class DictionaryUnionEnumerator : CheckedDictionaryEnumerator
|
||||
{
|
||||
private IList<IDictionaryEnumerator> _enums;
|
||||
|
||||
private int _current;
|
||||
|
||||
public DictionaryUnionEnumerator(IList<IDictionaryEnumerator> enums)
|
||||
{
|
||||
_enums = enums;
|
||||
}
|
||||
|
||||
protected override object GetKey()
|
||||
{
|
||||
return _enums[_current].Key;
|
||||
}
|
||||
|
||||
protected override object GetValue()
|
||||
{
|
||||
return _enums[_current].Value;
|
||||
}
|
||||
|
||||
protected override bool DoMoveNext()
|
||||
{
|
||||
if (_current == _enums.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (_enums[_current].MoveNext())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
_current++;
|
||||
return DoMoveNext();
|
||||
}
|
||||
|
||||
protected override void DoReset()
|
||||
{
|
||||
for (int i = 0; i < _enums.Count; i++)
|
||||
{
|
||||
_enums[i].Reset();
|
||||
}
|
||||
_current = 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue