示例#1
0
文件: JSMinify.cs 项目: tytok/YAFNET
        /// <summary>
        /// Minifies the specified input code.
        /// </summary>
        /// <param name="inputCode">
        /// The input code.
        /// </param>
        /// <returns>
        /// The minify.
        /// </returns>
        public static string Minify(string inputCode)
        {
            var minify     = new JSMinify();
            var outputCode = new StringBuilder();

            using (minify.textReader = new StringReader(inputCode))
            {
                using (minify.writer = new StringWriter(outputCode))
                {
                    minify.Pack();
                }
            }

            return(outputCode.ToString());
        }
示例#2
0
		/// <summary>
		/// Minifies the specified input code.
		/// </summary>
		/// <param name="inputCode">
		/// The input code. 
		/// </param>
		/// <returns>
		/// The minify. 
		/// </returns>
		public static string Minify(string inputCode)
		{
			var minify = new JSMinify();
			var outputCode = new StringBuilder();

			using (minify.textReader = new StringReader(inputCode))
			{
				using (minify.writer = new StringWriter(outputCode))
				{
					minify.Pack();
				}
			}

			return outputCode.ToString();
		}