Exemplo n.º 1
0
 static int Main(string[] args)
 {
     try
     {
         CommandLineViewer.RunWithCommandLineArguments(args);
         return(0);
     }
     catch (ModelProgramUserException e)
     {
         // Redirect the exception message to the console and quit.
         Console.Error.WriteLine(e.Message);
         return(-1);
     }
     catch (System.Reflection.TargetInvocationException e)
     {
         if (e.InnerException != null && e.InnerException is ModelProgramUserException)
         {
             // Redirect the exception message to the console and quit.
             Console.Error.WriteLine(e.InnerException.Message);
             return(-1);
         }
         else
         {
             Console.Error.WriteLine("Unexpected error occurred.");
             throw;
         }
     }
     catch
     {
         Console.Error.WriteLine("Unexpected error occurred.");
         throw;
     }
 }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     CommandLineViewer.RunWithCommandLineArguments(args);
 }