ArtifactEnumerator
using kCura.WinEDDS.Exporters;
using Polly;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Relativity.DataExchange.Export.VolumeManagerV2.Metadata.Writers
{
public class ArtifactEnumerator : IEnumerator<ObjectExportInfo>, IDisposable, IEnumerator
{
private readonly Context _context;
private readonly IEnumerator<ObjectExportInfo> _enumerator;
public ObjectExportInfo Current => _enumerator.Current;
object IEnumerator.Current {
get {
return Current;
}
}
public ArtifactEnumerator(ObjectExportInfo[] artifacts, Context context)
{
_context = context;
_enumerator = artifacts.Cast<ObjectExportInfo>().GetEnumerator();
}
public void Dispose()
{
_enumerator.Dispose();
}
public bool MoveNext()
{
bool num = _enumerator.MoveNext();
if (num)
UpdateContext();
return num;
}
public void Reset()
{
_enumerator.Reset();
}
private void UpdateContext()
{
if (Current != null)
_context.set_Item("LastArtifactId", (object)Current.ArtifactID);
}
}
}