Пример #1
0
        public BuildTaskResult(ProjectItemIdentifier identifier, IProjectItemContent content)
        {
            if (identifier == null)
                throw new ArgumentNullException(nameof(identifier));

            if (content == null)
                throw new ArgumentNullException(nameof(content));

            Identifier = identifier;
            Content = content;
        }
        public override async Task<Stream> OpenRead()
        {
            if (_contentBuffer == null)
            {
                // TODO: Verify async
                using (var stream = await _content.ReadAsync().ConfigureAwait(false))
                {
                    var contentStream = new MemoryStream();
                    await stream.CopyToAsync(contentStream).ConfigureAwait(false);

                    _contentBuffer = contentStream.ToArray();
                }

                _content = null;
            }

            return new MemoryStream(_contentBuffer);
        }
 public void SetDirty(IProjectItemContent content)
 {
     _content = content;
     _contentBuffer = null;
 }
 public DefferedProjectItem(ProjectItemIdentifier identifier, IProjectItemContent content) : base(identifier)
 {
     _content = content;
 }