Esempio n. 1
0
        private async Task <Item> LoadAsync(Item item)
        {
            switch (item.Type)
            {
            case ItemType.Html:
            case ItemType.Text:
                var stringContent = await _fileLoader.LoadStringAsync(item.Uri).ConfigureAwait(false);

                item.Content = stringContent;
                return(item);

            case ItemType.Binary:
                var byteContent = await _fileLoader.LoadBytesAsync(item.Uri).ConfigureAwait(false);

                item.ByteContent = byteContent;
                return(item);

            default:
                throw new ArgumentOutOfRangeException($"Unknown type of the Item ({item.Type})");
            }
        }