예제 #1
0
 static void Main( string[] args )
 {
     var app = new CodeCakeApplication();
     app.Run( args );
     // From: http://stackoverflow.com/questions/1188658/how-can-a-c-sharp-windows-console-application-tell-if-it-is-run-interactively
     if( Console.OpenStandardInput( 1 ) != Stream.Null )
     {
         Console.WriteLine();
         Console.WriteLine( "Interactive mode detected: hit any key to exit." );
         Console.ReadKey();
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            var app = new CodeCakeApplication();

            app.Run(args);
            // From: http://stackoverflow.com/questions/1188658/how-can-a-c-sharp-windows-console-application-tell-if-it-is-run-interactively
            if (Console.OpenStandardInput(1) != Stream.Null)
            {
                Console.WriteLine();
                Console.WriteLine("Interactive mode detected: hit any key to exit.");
                Console.ReadKey();
            }
        }
예제 #3
0
        static int Main(string[] args)
        {
            var  app         = new CodeCakeApplication();
            bool interactive = !args.Contains('-' + InteractiveAliases.NoInteractionArgument, StringComparer.OrdinalIgnoreCase);
            int  result      = app.Run(args);

            Console.WriteLine();
            if (interactive)
            {
                Console.WriteLine("Hit any key to exit. (Use -{0} parameter to exit immediately)", InteractiveAliases.NoInteractionArgument);
                Console.ReadKey();
            }
            return(result);
        }
예제 #4
0
        public static int Main(string[] args)
        {
            string solutionDir = Nth(Path.GetDirectoryName, PlatformServices.Default.Application.ApplicationBasePath, 6);
            var    app         = new CodeCakeApplication(string.Format("{0}\\", solutionDir), typeof(Program).Assembly);
            bool   interactive = !args.Contains('-' + InteractiveAliases.NoInteractionArgument, StringComparer.OrdinalIgnoreCase);
            int    result      = app.Run(args);

            Console.WriteLine();
            if (interactive)
            {
                Console.WriteLine("Hit any key to exit. (Use -{0} parameter to exit immediately)", InteractiveAliases.NoInteractionArgument);
                Console.ReadKey();
            }
            return(result);
        }