NodeEnumerable
using Relativity.DataTransfer.Nodes;
using Relativity.Transfer.Enumeration.Interfaces;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
namespace Relativity.Transfer.Enumeration
{
internal class NodeEnumerable : IEnumerable<INode>, IEnumerable
{
private readonly INode _sourceNode;
private readonly INodeFactory _nodeFactory;
private readonly ITransferLog _logger;
private readonly CancellationToken _token;
private readonly INativeMethods _nativeMethods;
internal NodeEnumerable(INode sourceNode, INodeFactory nodeFactory, INativeMethods nativeMethods, ITransferLog logger, CancellationToken token)
{
_sourceNode = sourceNode;
_nodeFactory = nodeFactory;
_nativeMethods = nativeMethods;
_logger = logger;
_token = token;
}
public IEnumerator<INode> GetEnumerator()
{
return new NativeNodeEnumerator(_sourceNode, _nodeFactory, _nativeMethods, _logger, _token);
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}