예제 #1
0
        public BlobBlockTextContentReader(IListBlobItem item,
                                          ContentReaderDynamicParameters contentReaderDynamicParameters)
        {
            _contentReaderDynamicParameters = contentReaderDynamicParameters;

            var blob = (CloudBlockBlob)item;

            _reader = new StreamReader(blob.OpenRead());
        }
예제 #2
0
        public override IContentReader GetContentReader(IProviderContext providerContext)
        {
            var p = providerContext.DynamicParameters as ContentReaderDynamicParameters;

            if (null == p)
            {
                p = new ContentReaderDynamicParameters();
            }

            if (p.AsText || p.Raw || null != p.Delimiter)
            {
                p.AsText    = new SwitchParameter(true);
                p.Delimiter = p.Delimiter ?? Environment.NewLine;

                return(new BlobBlockTextContentReader(BlobItem, p));
            }

            return(new BlobBlockBinaryContentReader(BlobItem));
        }