Esempio n. 1
0
        static void Main(string[] args)
        {
            var app = new Application(Platform.Detect);

            Styles.Load();

#if WINDOWS
            Xwt.Application.InitializeAsGuest(Xwt.ToolkitType.Wpf);
#elif LINUX
            Xwt.Application.InitializeAsGuest(Xwt.ToolkitType.Gtk3);
#endif

            var win        = new MainWindow();
            var controller = PipelineController.Create(win);

            string project = null;

            if (Global.Unix && !Global.Linux)
            {
                project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
            }
            else if (args != null && args.Length > 0)
            {
                project = string.Join(" ", args);
            }

            if (!string.IsNullOrEmpty(project))
            {
                controller.OpenProject(project);
            }

            app.Run(win);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Styles.Load();

            var app = new Application(Platform.Detect);

            app.Style = "PipelineTool";

            var win        = new MainWindow();
            var controller = PipelineController.Create(win);

#if LINUX
            Global.Application.AddWindow(win.ToNative() as Gtk.Window);
#endif

            string project = null;

            if (Global.Unix && !Global.Linux)
            {
                project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
            }
            else if (args != null && args.Length > 0)
            {
                project = string.Join(" ", args);
            }

            if (!string.IsNullOrEmpty(project))
            {
                controller.OpenProject(project);
            }

            app.Run(win);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var platform = Platform.Detect;

            var app = new Application(platform);

            Styles.Load();

            var win        = new MainWindow();
            var controller = PipelineController.Create(win);

            string project = null;

            if (Global.Unix && !Global.Linux)
            {
                project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
            }
            else if (args != null && args.Length > 0)
            {
                project = string.Join(" ", args);
            }

            if (!string.IsNullOrEmpty(project))
            {
                controller.OpenProject(project);
            }

            app.Run(win);
        }
Esempio n. 4
0
            public void Run(InvocationContext context, string project)
            {
                Styles.Load();

#if GTK
                var app = new Application(Platforms.Gtk);
#elif WPF
                var app = new Application(Platforms.Wpf);
#else
                var app = new Application(Platforms.Mac64);
#endif

                app.Style = "PipelineTool";

                PipelineSettings.Default.Load();

                if (!string.IsNullOrEmpty(PipelineSettings.Default.ErrorMessage))
                {
                    var logwin = new LogWindow();
                    logwin.LogText = PipelineSettings.Default.ErrorMessage;
                    app.Run(logwin);
                    return;
                }

#if !DEBUG
                try
#endif
                {
                    var win        = new MainWindow();
                    var controller = PipelineController.Create(win);

#if GTK
                    Global.Application.AddWindow(win.ToNative() as Gtk.Window);
#endif

#if GTK && !DEBUG
                    GLib.ExceptionManager.UnhandledException += (e) =>
                    {
                        var logwin = new LogWindow();
                        logwin.LogText = e.ExceptionObject.ToString();

                        logwin.Show();
                        win.Close();
                    };
#endif

                    if (!string.IsNullOrEmpty(project))
                    {
                        controller.OpenProject(project);
                    }

                    app.Run(win);
                }
#if !DEBUG
                catch (Exception ex)
                {
                    PipelineSettings.Default.ErrorMessage = ex.ToString();
                    PipelineSettings.Default.Save();
                    app.Restart();
                }
#endif
            }