protected override void OnStyleImport(StyleImport styleImport)
 {
     if (FlagNotSet(Flag.RemoveStyles))
     {
         base.OnStyleImport(styleImport);
     }
 }
 protected override void OnStyleImport(StyleImport styleImport)
 {
     if (styleImport != null)
     {
         styleImport.LiteralText = ReplaceUrlAsNecessary(styleImport.LiteralText);
     }
     Emit(styleImport);
     base.OnStyleImport(styleImport);
 }
 protected override void OnStyleImport(StyleImport styleImport)
 {
     if (styleImport != null)
     {
         string url = styleImport.LiteralText;
         if (!UrlHelper.IsUrl(url))
         {
             styleImport.LiteralText = UrlHelper.EscapeRelativeURL(BaseUrl, url);
         }
     }
     base.OnStyleImport(styleImport);
 }
Beispiel #4
0
        protected override void OnStyleImport(StyleImport styleImport)
        {
            if (styleImport == null || _scriptDepth > 0)
            {
                return;
            }

            styleImport.LiteralText = ReplaceValue(styleImport.LiteralText);
            Emit(styleImport.ToString());

            base.OnStyleImport(styleImport);
        }
        public void Parse()
        {
            CssParser parser = new CssParser(_css);

            OnDocumentBegin();
            while (true)
            {
                StyleElement element = parser.Next();

                if (element == null)
                {
                    OnDocumentEnd();
                    return;
                }

                StyleText styleText = element as StyleText;
                if (styleText != null)
                {
                    OnStyleText(styleText);
                }

                StyleLiteral styleLiteral = element as StyleLiteral;
                if (styleLiteral != null)
                {
                    OnStyleLiteral(styleLiteral);
                }

                StyleUrl styleUrl = element as StyleUrl;
                if (styleUrl != null)
                {
                    OnStyleUrl(styleUrl);
                }

                StyleImport styleImport = element as StyleImport;
                if (styleImport != null)
                {
                    OnStyleImport(styleImport);
                }

                StyleComment styleComment = element as StyleComment;
                if (styleComment != null)
                {
                    OnStyleComment(styleComment);
                }
            }
        }
Beispiel #6
0
        public static PageViewDefinition IncludeStyle(this PageViewDefinition viewDefinition, string styleSource)
        {
            var script = new StyleImport {
                Href = styleSource
            };

            EnsureData(viewDefinition);

            if (viewDefinition.Data.Styles == null)
            {
                viewDefinition.Data.Styles = new List <StyleImport>();
            }

            viewDefinition.Data.Styles.Add(script);

            return(viewDefinition);
        }
 protected override void OnStyleImport(StyleImport styleImport)
 {
     _styleImports.Add(new UrlInfo(styleImport.LiteralText, HTMLTokens.Import));
     base.OnStyleImport(styleImport);
 }
 protected virtual void OnStyleImport(StyleImport styleImport)
 {
 }
Beispiel #9
0
 protected override void OnStyleImport(StyleImport styleImport)
 {
 }
        public void Parse()
        {
            SimpleHtmlParser parser = new SimpleHtmlParser(_html);

            OnDocumentBegin();
            while (true)
            {
                Element currentElement = parser.Next();

                BeginTag beginTag = currentElement as BeginTag;
                if (beginTag != null)
                {
                    OnBeginTag(beginTag);
                    continue;
                }

                EndTag endTag = currentElement as EndTag;
                if (endTag != null)
                {
                    OnEndTag(endTag);
                    continue;
                }

                ScriptLiteral literal = currentElement as ScriptLiteral;
                if (literal != null)
                {
                    OnScriptLiteral(literal);
                    continue;
                }

                Comment comment = currentElement as Comment;
                if (comment != null)
                {
                    OnComment(comment);
                    continue;
                }

                MarkupDirective markupDirective = currentElement as MarkupDirective;
                if (markupDirective != null)
                {
                    OnMarkupDirective(markupDirective);
                    continue;
                }

                ScriptText scriptText = currentElement as ScriptText;
                if (scriptText != null)
                {
                    OnScriptText(scriptText);
                    continue;
                }

                ScriptComment scriptComment = currentElement as ScriptComment;
                if (scriptComment != null)
                {
                    OnScriptComment(scriptComment);
                    continue;
                }

                StyleText styleText = currentElement as StyleText;
                if (styleText != null)
                {
                    OnStyleText(styleText);
                    continue;
                }

                StyleUrl styleUrl = currentElement as StyleUrl;
                if (styleUrl != null)
                {
                    OnStyleUrl(styleUrl);
                    continue;
                }

                StyleImport styleImport = currentElement as StyleImport;
                if (styleImport != null)
                {
                    OnStyleImport(styleImport);
                    continue;
                }

                StyleComment styleComment = currentElement as StyleComment;
                if (styleComment != null)
                {
                    OnStyleComment(styleComment);
                    continue;
                }

                StyleLiteral styleLiteral = currentElement as StyleLiteral;
                if (styleLiteral != null)
                {
                    OnStyleLiteral(styleLiteral);
                    continue;
                }

                Text text = currentElement as Text;
                if (text != null)
                {
                    OnText(text);
                    continue;
                }


                if (currentElement == null)
                {
                    OnDocumentEnd();
                    return;
                }

                Debug.Fail("Unrecognized element in LightWeightHTMLDocumentIterator");
            }
        }
 protected virtual void OnStyleImport(StyleImport styleImport)
 {
     DefaultAction(styleImport);
 }