Esempio n. 1
0
        public static int Main(string[] args)
        {
            ProgramUtils.Init();

            using var handler = new CliTaskHandler();
            return((int)ProgramUtils.Run(args, handler, gui: false));
        }
Esempio n. 2
0
        /// <summary>
        /// Runs the application in GUI mode.
        /// </summary>
        /// <param name="args">The command-line arguments passed to the application.</param>
        /// <returns>The exit status code to end the process with.</returns>
        public static ExitCode RunGui(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ErrorReportForm.SetupMonitoring(new Uri("https://0install.de/error-report/"));

            using var handler = new GuiTaskHandler();
            return(ProgramUtils.Run(args, handler, gui: true));
        }
Esempio n. 3
0
 /// <summary>
 /// Runs the application in command-line mode with special-case handling for retroactively attached Windows consoles.
 /// </summary>
 /// <param name="args">The command-line arguments passed to the application.</param>
 /// <returns>The exit status code to end the process with.</returns>
 public static ExitCode RunCliRedirect(string[] args)
 {
     using var handler = new CliTaskHandler();
     try
     {
         Console.WriteLine();
         return(ProgramUtils.Run(args, handler, gui: false));
     }
     finally
     {
         if (handler.Verbosity != Verbosity.Batch)
         {
             Console.WriteLine();
             Console.Write(Environment.CurrentDirectory + @">");
         }
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Runs the application in command-line mode.
 /// </summary>
 /// <param name="args">The command-line arguments passed to the application.</param>
 /// <returns>The exit status code to end the process with.</returns>
 public static ExitCode RunCli(string[] args)
 {
     using var handler = new CliTaskHandler();
     return(ProgramUtils.Run(args, handler, gui: false));
 }