예제 #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();
		}