Example #1
0
        private async Task CreateSheetAsync(IStylingService engine, IDocument document)
        {
            var cancel   = CancellationToken.None;
            var response = VirtualResponse.Create(res => res.Content(TextContent).Address(default(Url)));
            var options  = new StyleOptions(document)
            {
                Element     = this,
                IsDisabled  = IsDisabled,
                IsAlternate = false
            };
            var task = engine.ParseStylesheetAsync(response, options, cancel);

            _sheet = await task.ConfigureAwait(false);
        }
Example #2
0
        protected override async Task ProcessResponseAsync(IResponse response)
        {
            var cancel  = CancellationToken.None;
            var options = new StyleOptions(_link.Owner)
            {
                Element     = _link,
                IsDisabled  = _link.IsDisabled,
                IsAlternate = _link.RelationList.Contains(Keywords.Alternate)
            };

            var task  = _engine.ParseStylesheetAsync(response, options, cancel);
            var sheet = await task.ConfigureAwait(false);

            sheet.Media.MediaText = _link.Media ?? String.Empty;
            Sheet = sheet;
        }