示例#1
0
        public static void Main(string [] args)
        {
            try {
                Unix.SetProcessName("gbrainy");
            }
            catch (Exception e)
            {
                Console.WriteLine("gbrainy.Main. Could not set process name. Error {0}", e);
            }

            DateTime      start_time   = DateTime.Now;
            ITranslations translations = new TranslationsCatalog();

            InitCoreLibraries();

            GtkClient app = new GtkClient(translations);

            CommandLine.Version();

            CommandLine line = new CommandLine(translations, args);

            line.Parse();

            if (line.Continue == false)
            {
                return;
            }

            Gtk.Application.Init();

            app.Initialize();
            // Set RandomOrder before setting the custom list then it has effect of custom games
            app.Session.PlayList.RandomOrder = line.RandomOrder;
            if (line.PlayList.Length > 0)
            {
                app.Session.PlayList.PlayList = line.PlayList;
                app.InitialSessionType        = GameSession.Types.Custom;
            }
            app.ProcessDefaults();
            ThemeManager.Load();

            TimeSpan span = DateTime.Now - start_time;

            Console.WriteLine(Catalog.GetString("Startup time {0}"), span);
            Gtk.Application.Run();
        }