コード例 #1
0
ファイル: ProgramManager.cs プロジェクト: Rupsbant/IdpGie
        /// <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);
        }
コード例 #2
0
ファイル: OutputDevice.cs プロジェクト: KULeuven-KRR/IdpGie
 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);
     }
 }
コード例 #3
0
ファイル: ProgramManager.cs プロジェクト: KULeuven-KRR/IdpGie
 /// <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;
 }