public DownloadInfo(PartialDownloadMessageAdapter adapter, MarketDataMessage origin, TimeSpan step, TimeSpan iterationInterval)
            {
                _adapter           = adapter ?? throw new ArgumentNullException(nameof(adapter));
                Origin             = origin ?? throw new ArgumentNullException(nameof(origin));
                _step              = step;
                _iterationInterval = iterationInterval;

                var from = origin.From;

                if (from == null)
                {
                    throw new ArgumentException(nameof(origin));
                }

                _currFrom       = from.Value;
                _firstIteration = true;
            }
Пример #2
0
            public DownloadInfo(PartialDownloadMessageAdapter adapter, MarketDataMessage origin, TimeSpan step, TimeSpan iterationInterval)
            {
                if (step <= TimeSpan.Zero)
                {
                    throw new ArgumentOutOfRangeException(nameof(step));
                }

                if (iterationInterval < TimeSpan.Zero)
                {
                    throw new ArgumentOutOfRangeException(nameof(iterationInterval));
                }

                _adapter           = adapter ?? throw new ArgumentNullException(nameof(adapter));
                Origin             = origin ?? throw new ArgumentNullException(nameof(origin));
                _step              = step;
                _iterationInterval = iterationInterval;

                _maxFrom  = origin.To ?? DateTimeOffset.Now;
                _currFrom = origin.From ?? _maxFrom - step;

                _firstIteration = true;
            }