コード例 #1
0
ファイル: Program.cs プロジェクト: liftir/airvpn-client
		static void Main()
		{
			//Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			Platform.Instance = new AirVPN.Platforms.Windows();
			
			CommandLine.InitSystem(Environment.CommandLine);

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

				if (engine.Initialization())
				{
					engine.ConsoleStart();
				}
			}
			else
			{
				GuiUtils.Init();

				Gui.Engine engine = new Gui.Engine();

				if (engine.Initialization())
				{
					engine.FormMain = new Gui.Forms.Main();

					engine.UiStart();

					Application.Run(engine.FormMain);
				}
			}
		}
コード例 #2
0
ファイル: Program.cs プロジェクト: Clodo76/airvpn-client
        static void Main()
        {
            try
            {
                if (Environment.OSVersion.Version.Major >= 6)
                    SetProcessDPIAware();

                //Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                Platform.Instance = new Eddie.Platforms.Windows();

                CommandLine.InitSystem(Environment.CommandLine);

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

                    if (engine.Initialization(true))
                    {
                        engine.ConsoleStart();
                    }
                }
                else
                {
                    GuiUtils.Init();

                    Gui.Engine engine = new Gui.Engine();

                    engine.TerminateEvent += Engine_TerminateEvent;

                    if (engine.Initialization(false))
                    {
                        engine.FormMain = new Gui.Forms.Main();

                        engine.UiStart();

                        // Application.Run(engine.FormMain); // Removed in 2.11.9

                        engine.FormMain.LoadPhase();

                        m_context = new ApplicationContext();
                        Application.Run(m_context);
                    }
                }
            }
            catch(Exception e)
            {
                MessageBox.Show(e.Message, Constants.Name2, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }