/// <summary> /// Creates an HTML style element. /// </summary> internal HTMLStyleElement() { _name = Tag; _sheet = new CSSStyleSheet(); _sheet.OwnerNode = this; _children.ElementsChanged += OnChildrenChanged; }
public static void StyleFromSource(CSSStyleSheet sheet, String source) { if (sheet.Options.IsStyling) { var parser = new CssParser(sheet, source); parser.Parse(); } }
/// <summary> /// Creates a new builder with the specified source. /// </summary> /// <param name="source">The code manager.</param> /// <param name="sheet">The document to fill.</param> /// <param name="options">Options to use for the document generation.</param> DocumentBuilder(SourceManager source, CSSStyleSheet sheet, DocumentOptions options) { sheet.Options = options; parser = new CssParser(sheet, source); parser.ErrorOccurred += ParseErrorOccurred; if (options.OnError != null) parser.ErrorOccurred += options.OnError; }
public static void StyleFromUrl(CSSStyleSheet sheet, String url) { //TODO we need the IoC container to resolve stream getters etc. return; var stream = Stream(url); var parser = new CssParser(sheet, stream); parser.Parse(); }
public static async Task StyleFromUrl(CSSStyleSheet sheet, String url, CancellationToken cancel) { if (sheet.Options.IsStyling && Configuration.UseDefaultHttpRequester) { var stream = await GetFromUrl(url, cancel); var parser = new CssParser(sheet, stream); parser.Parse(); } }
public static async Task StyleFromUrl(CSSStyleSheet sheet, String url, CancellationToken cancel) { if (sheet.Options.IsStyling) { var stream = await GetFromUrl(url, cancel); var parser = new CssParser(sheet, stream); parser.Parse(); } }
/// <summary> /// Creates a new CSS parser instance parser with the specified stylesheet /// based on the given source manager. /// </summary> /// <param name="stylesheet">The stylesheet to be constructed.</param> /// <param name="source">The source to use.</param> internal CssParser(CSSStyleSheet stylesheet, SourceManager source) { ignore = true; buffer = new StringBuilder(); tokenizer = new CssTokenizer(source); tokenizer.ErrorOccurred += (s, ev) => { if (ErrorOccurred != null) ErrorOccurred(this, ev); }; started = false; sheet = stylesheet; open = new Stack<CSSRule>(); }
/// <summary> /// Creates a new CSS parser instance with the specified stylesheet /// based on the given stream. /// </summary> /// <param name="stylesheet">The stylesheet to be constructed.</param> /// <param name="stream">The stream to use as source.</param> public CssParser(CSSStyleSheet stylesheet, Stream stream) : this(stylesheet, new SourceManager(stream)) { }
/// <summary> /// Creates a new CSS parser instance with the specified stylesheet /// based on the given source. /// </summary> /// <param name="stylesheet">The stylesheet to be constructed.</param> /// <param name="source">The source code as a string.</param> public CssParser(CSSStyleSheet stylesheet, String source) : this(stylesheet, new SourceManager(source)) { }
/// <summary> /// Creates a new HTML link element. /// </summary> internal HTMLLinkElement() { _name = Tag; _sheet = new CSSStyleSheet(); _sheet.OwnerNode = this; }
/// <summary> /// Creates a new builder with the specified source. /// </summary> /// <param name="source">The code manager.</param> /// <param name="sheet">The document to fill.</param> DocumentBuilder(SourceManager source, CSSStyleSheet sheet) { parser = new CssParser(sheet, source); parser.ErrorOccurred += ParseErrorOccurred; }