public IEnumerable <T> Stream <T>(bool forwards = true, int startingAt = 0) where T : IBlockSerialized
        {
            var type = _typeProvider.Get(typeof(T));

            if (!type.HasValue)
            {
                yield break;
            }

            foreach (var item in _source.StreamAllBlockObjects(forwards, startingAt))
            {
                if (!item.Type.HasValue || item.Type != type)
                {
                    continue;
                }

                yield return((T)item.Data);
            }
        }
Esempio n. 2
0
 public IEnumerable <BlockObject> StreamAllBlockObjects(bool forwards, long startingAt = 0)
 {
     return(_blocks.StreamAllBlockObjects(forwards, startingAt));
 }