private void RunButton_Click(object sender, EventArgs e)
        {
            Button b = (Button)sender;

            foreach (Tuple <Label, Button, Button, Button, Button> serverGUI in serverGUIs)
            {
                if (serverGUI.Item2.Equals(b))
                {
                    MemorySize    min    = new MemorySize(500, "M");
                    MemorySize    max    = new MemorySize(2, "G");
                    ServerConsole output = new ServerConsole();

                    bool signed = manager.RunServer(serverGUI.Item1.Text, min, max, output, false);
                    if (signed)
                    {
                        string  tabName    = serverGUI.Item1.Text + " Output";
                        TabPage outputPage = CreateTabPage(tabName);

                        SetupTabPage(outputPage, output);
                    }
                    else
                    {
                        string  tabName  = serverGUI.Item1.Text + " EULA";
                        TabPage eulaPage = CreateTabPage(tabName);
                        EULA    eula     = new EULA(serverGUI.Item1.Text, manager, this);
                        SetupTabPage(eulaPage, eula);
                    }
                }
            }
        }
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        string path = Path.GetDirectoryName(Application.ExecutablePath);
        string file = Path.Combine(path, "EULA.txt");

        if (File.Exists(file))
        {
            var form1 = new Form1();
            form1.Closed += (s, args) => this.Close();
            form1.Show();
        }
        else
        {
            var eula = new EULA();
            eula.Show();
        }
    }
Exemplo n.º 3
0
        private void StartUpLoaded(object sender, RoutedEventArgs e)
        {
            this.InitializeImages();
            this.InitializeOptions();

            // UI Language
            switch (Core.Core.Instanse.Options.Language)
            {
            case LanguageType.English:
            {
                RunTime.Instance.Localization = new ResourceManager("Umax.Resources.Localization.UI.Classic.English", typeof(Umax.Resources.Localization.UI.Classic.English).Assembly);
                break;
            }

            case LanguageType.Russian:
            {
                RunTime.Instance.Localization = new ResourceManager("Umax.Resources.Localization.UI.Classic.Russian", typeof(Umax.Resources.Localization.UI.Classic.Russian).Assembly);
                break;
            }
            }

            this.InitializeUI();

            // Checking .Net FX
            if (!WindowsHelper.FXCheck())
            {
                if (WinHelper.MessageBox("Microsoft .Net Framework 3.5 isn't installed. Please install it!\r\nDo you like to ignore and continue?", "Error!", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == System.Windows.Forms.DialogResult.No)
                {
                    WPFApplication.Current.Shutdown();
                }
            }

            // Update check
            if (WindowsHelper.UpdateFilesAvailable())
            {
                WindowsHelper.StartMonitor("-update -quiet");
                Close();
            }

            // Initializing Core
            this.InitializeCore();

            // Monitor
            if (GuiOptions.Instanse.Monitor)
            {
                WindowsHelper.StartMonitor("-quiet");
            }

            // Checking accepting EULA
            if (!WindowsHelper.EulaCheck())
            {
                using (EULA eulaWindow = new EULA())
                {
                    eulaWindow.ShowDialog();

                    if (!eulaWindow.Accepted)
                    {
                        this.Close();
                    }
                }
            }

            this.ShowMainWindow();
        }