Exemplo n.º 1
0
        /// <summary>
        /// The entry point of the program, where the program control starts and ends.
        /// </summary>
        /// <param name='args'>
        /// The command-line arguments.
        /// </param>
        /// <returns>
        /// The exit code that is given to the operating system after the program ends.
        /// </returns>
        public static int Main(string[] args)
        {
            Catalog.Init("IdpGie", "./locale");
            OutputDevice.AnalyzeAssembly(Assembly.GetExecutingAssembly());
            WebShapeBase.AnalyzeAssembly(Assembly.GetExecutingAssembly());
            ProgramManager manager = new ProgramManager();

            try {
                manager.Run(args);
            } catch (Exception e) {
                Console.Error.Write("ERROR: ");
                Console.Error.WriteLine(e.Message);
                Console.Error.WriteLine(e.StackTrace);
                Console.Error.WriteLine("Try `idpgie --help' for more information.");
                return(0x01);
            }
            return(0x00);
        }
Exemplo n.º 2
0
 public static OutputDevice CreateDevice(string name, DrawTheory theory, ProgramManager pm)
 {
     Tuple<string,ConstructorInfo> ci;
     if (constructors.TryGetValue (name.Trim ().ToLower (), out ci)) {
         try {
             return (OutputDevice)ci.Item2.Invoke (new object[] { theory, pm });
         } catch (Exception e) {
             Console.WriteLine (e.InnerException);
             throw e;
         }
     } else {
         throw new IdpGieException ("Cannot find the appropriate output device \"{0}\". Run `idp --list-devices' for a list of installed devices.", name);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// The entry point of the program, where the program control starts and ends.
 /// </summary>
 /// <param name='args'>
 /// The command-line arguments.
 /// </param>
 /// <returns>
 /// The exit code that is given to the operating system after the program ends.
 /// </returns>
 public static int Main(string[] args)
 {
     Catalog.Init ("IdpGie", "./locale");
     OutputDevice.AnalyzeAssembly (Assembly.GetExecutingAssembly ());
     WebShapeBase.AnalyzeAssembly (Assembly.GetExecutingAssembly ());
     ProgramManager manager = new ProgramManager ();
     try {
         manager.Run (args);
     } catch (Exception e) {
         Console.Error.Write ("ERROR: ");
         Console.Error.WriteLine (e.Message);
         Console.Error.WriteLine (e.StackTrace);
         Console.Error.WriteLine ("Try `idpgie --help' for more information.");
         return 0x01;
     }
     return 0x00;
 }