コード例 #1
0
ファイル: Terminal.cs プロジェクト: asbjornu/Uglify.NET
      private static void Main()
      {
         try
         {
            Console.WriteLine("Loading...");
            
            Uglifier uglifier = new Uglifier();

            Console.WriteLine("Uglify loaded");

            var result = uglifier.Uglify("var asdfg = 1234;");

            Console.WriteLine(result);
         }
         catch (TargetInvocationException exception)
         {
            Console.WriteLine(exception.InnerException);
         }
         catch (Exception exception)
         {
            Console.WriteLine(exception);
         }

         Console.WriteLine();
         Console.WriteLine();
         Console.WriteLine("Press any key to exit.");
         Console.ReadKey();
      }
コード例 #2
0
      public void Uglify_ReturnsUglifiedCode()
      {
         var uglifier = new Uglifier();

         // TODO: Find verbose and complicated code to uglify.
         uglifier.Uglify("(function(){ var x = 'hello world'; }();");
      }
コード例 #3
0
ファイル: Terminal.cs プロジェクト: bondehagen/Uglify.NET
      private static void Main()
      {
         try
         {
            Console.WriteLine("Loading...");

            Uglifier uglifier = new Uglifier();
            Console.WriteLine("Uglify executed!");

            var uglyCode = uglifier.Uglify("var a = 1 + 1;");
            Console.WriteLine("Code: " + uglyCode);
         }
         catch (TargetInvocationException exception)
         {
            Console.WriteLine(exception.InnerException);
         }
         catch (Exception exception)
         {
            Console.WriteLine(exception);
         }

         Console.WriteLine();
         Console.WriteLine();
         Console.WriteLine("Press any key to exit.");
         Console.ReadKey();
      }