Esempio n. 1
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();
        }
Esempio n. 2
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);
            }
        }