public LargeTextSourceDocument(StreamReader reader, int chunkMaxLength, Encoding encoding, RazorSourceDocumentProperties properties)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            if (encoding == null)
            {
                throw new ArgumentNullException(nameof(encoding));
            }

            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            _chunkMaxLength = chunkMaxLength;
            Encoding        = encoding;
            FilePath        = properties.FilePath;
            RelativePath    = properties.RelativePath;

            ReadChunks(reader, _chunkMaxLength, out _length, out _chunks);
            _lines = new DefaultRazorSourceLineCollection(this);
        }
        public StringSourceDocument(string content, Encoding encoding, string filePath)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }

            if (encoding == null)
            {
                throw new ArgumentNullException(nameof(encoding));
            }

            _content = content;
            Encoding = encoding;
            FilePath = filePath;

            _lines = new DefaultRazorSourceLineCollection(this);
        }
        public LargeTextSourceDocument(StreamReader reader, int chunkMaxLength, Encoding encoding, string fileName)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            if (encoding == null)
            {
                throw new ArgumentNullException(nameof(encoding));
            }

            _chunkMaxLength = chunkMaxLength;
            Encoding        = encoding;
            FilePath        = fileName;

            ReadChunks(reader, _chunkMaxLength, out _length, out _chunks);
            _lines = new DefaultRazorSourceLineCollection(this);
        }
示例#4
0
        public StringSourceDocument(string content, Encoding encoding, RazorSourceDocumentProperties properties)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }

            if (encoding == null)
            {
                throw new ArgumentNullException(nameof(encoding));
            }

            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            _content     = content;
            Encoding     = encoding;
            FilePath     = properties.FilePath;
            RelativePath = properties.RelativePath;

            _lines = new DefaultRazorSourceLineCollection(this);
        }