Ejemplo n.º 1
0
        public override bool Init(string environmentCommandLine)
        {
            Instance = this;

            base.Init(environmentCommandLine);

            SplashWindow = new WindowSplashController();
            SplashWindow.Window.MakeKeyAndOrderFront(AppDelegate);

            Engine = new Engine(environmentCommandLine);
            Engine.UiManager.Add(this);
            Engine.TerminateEvent += delegate()
            {
                new NSObject().InvokeOnMainThread(() => // BeginInvokeOnMainThread
                {
                    if (MainWindow != null)
                    {
                        MainWindow.Close();
                    }
                    if (SplashWindow != null)
                    {
                        SplashWindow.Close();
                    }

                    //NSApplication.SharedApplication.ReplyToApplicationShouldTerminate (true);
                    NSApplication.SharedApplication.Terminate(new NSObject());
                });
            };

            Engine.Start();

            return(true);
        }
Ejemplo n.º 2
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            NSApplication.SharedApplication.ActivateIgnoringOtherApps(true);

            NSProcessInfo.ProcessInfo.DisableSuddenTermination(); // Already disabled by default

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            UiClient client = new UiClient();

            client.AppDelegate = this;
            client.Init(Environment.CommandLine);

            MenuEvents();
        }
Ejemplo n.º 3
0
        public override bool Init()
        {
            base.Init();

            Instance = this;

            Engine = new Engine();

            if (Engine.Initialization(false) == false)
            {
                return(false);
            }

            Engine.UiManager.Add(this);

            return(true);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            NSApplication.Init();

            Core.Platform.Instance = new Eddie.Platform.MacOS.Platform();

            CommandLine.InitSystem(Environment.CommandLine);

            // Due to a bug in Xamarin, that don't recognize resources inside Core library if Mono is bundled, we embed some resources in entry assembly.

            Core.ResourcesFiles.LoadString(Assembly.GetEntryAssembly(), "license.txt", "License.txt");
            Core.ResourcesFiles.LoadString(Assembly.GetEntryAssembly(), "thirdparty.txt", "ThirdParty.txt");
            Core.ResourcesFiles.LoadString(Assembly.GetEntryAssembly(), "tos.txt", "TOS.txt");
            Core.ResourcesFiles.LoadString(Assembly.GetEntryAssembly(), "AirVPN.xml", "AirVPN.xml");
            Core.ResourcesFiles.LoadString(Assembly.GetEntryAssembly(), "OpenVPN.xml", "OpenVPN.xml");

            Core.ResourcesFiles.Count();

            if (CommandLine.SystemEnvironment.Exists("cli"))
            {
                Core.Engine engine = new Core.Engine();

                if (engine.Initialization(true))
                {
                    engine.ConsoleStart();
                    engine.Join();
                }
            }
            else
            {
                UiClient client = new UiClient();
                if (client.Init() == false)
                {
                    return;
                }

                NSApplication.Main(args);
            }
        }