Пример #1
0
        // Compile all loaded script to a string
        public string CompileCssToString()
        {
            // Step 1, concatenate all files
            var sb = new StringBuilder();

            foreach (var file in m_files)
            {
                Console.WriteLine("Processing {0}...", System.IO.Path.GetFileName(file.filename));
                sb.Append(file.content);
                sb.Append("\n");
            }

            // Do the CSS compression
            var minified = new CssMin().Minify(sb.ToString(), MaxLineLength);

            // Return it
            return(minified);
        }
Пример #2
0
        /// <summary>
        /// Compile all loaded scripts to a string, using the css minifier.
        /// </summary>
        /// <returns>The compiled styles.</returns>
        public string CompileCssToString()
        {
            // Step 1, concatenate all files
            var sb = new StringBuilder();
            foreach (var file in m_files)
            {
                Console.WriteLine("Processing {0}...", System.IO.Path.GetFileName(file.filename));
                sb.Append(file.content);
                sb.Append("\n");
            }

            // Do the CSS compression
            var minified = new CssMin().Minify(sb.ToString(), MaxLineLength);

            // Return it
            return minified;
        }