Example #1
0
        public override string ToString()
        {
            var sb = StringBuilderCache.Aquire();

            using var sw = new StringWriter(sb);

            var writer = new CssWriter(sw);

            writer.WriteStyleRule(this, 0);

            return(StringBuilderCache.ExtractAndRelease(sb));
        }
Example #2
0
        public void WriteTo(TextWriter textWriter, IEnumerable <KeyValuePair <string, CssValue> > variables)
        {
            var scope = new CssScope();

            foreach (var v in variables)
            {
                scope.Add(v.Key, v.Value);
            }

            var writer = new CssWriter(textWriter, Context, scope, resolver);

            writer.WriteRoot(this);
        }
Example #3
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            using (var sw = new StringWriter(sb))
            {
                var writer = new CssWriter(sw);

                writer.WriteStyleRule(this, 0);

                return sb.ToString();
            }
        }
Example #4
0
        public void WriteTo(TextWriter textWriter)
        {
            var writer = new CssWriter(textWriter, Context, new CssScope(), resolver);

            writer.WriteRoot(this);
        }
Example #5
0
        public void WriteTo(TextWriter textWriter, IEnumerable<KeyValuePair<string, CssValue>> variables)
        {
            var scope = new CssScope();

            foreach (var v in variables)
            {
                scope.Add(v.Key, v.Value);
            }

            var writer = new CssWriter(textWriter, Context, scope, resolver);

            writer.WriteRoot(this);
        }
Example #6
0
        public void WriteTo(TextWriter textWriter)
        {
            var writer = new CssWriter(textWriter, Context, new CssScope(), resolver);

            writer.WriteRoot(this);
        }