Exemplo n.º 1
0
        /// <summary>
        /// Creates a style declaration for the given source.
        /// </summary>
        /// <param name="source">
        /// The source code for the inline style declaration.
        /// </param>
        /// <param name="options">
        /// The options with the parameters for evaluating the style.
        /// </param>
        /// <returns>The created style declaration.</returns>
        public ICssStyleDeclaration ParseInline(String source, StyleOptions options)
        {
            var parser = new CssParser(_options, options.Configuration);
            var style  = new CssStyleDeclaration(parser);

            style.Update(source);
            return(style);
        }
Exemplo n.º 2
0
        internal static CssStyleDeclaration ParseDeclarations(String declarations)
        {
            var parser = new CssParser();
            var style  = new CssStyleDeclaration(parser);

            style.Update(declarations);
            return(style);
        }
        internal static CssStyleDeclaration ParseDeclarations(String declarations)
        {
            var context = BrowsingContext.New(Configuration.Default.WithCss());
            var parser  = context.GetService <ICssParser>();
            var style   = new CssStyleDeclaration(context);

            style.Update(declarations);
            return(style);
        }
Exemplo n.º 4
0
        void UpdateStyle(String value)
        {
            if (String.IsNullOrEmpty(value))
            {
                Attributes.Remove(Attributes.Get(AttributeNames.Style));
            }

            if (_style != null)
            {
                _style.Update(value);
            }
        }