Пример #1
0
        private void ButtonAddNewConsole_Click(object sender, EventArgs e)
        {
            foreach (object control in PanelConsoleProfiles.Controls)
            {
                if (control is ConsoleItem item)
                {
                    item.ShouldHover = false;
                }
            }

            ConsoleProfile consoleProfile = DialogExtensions.ShowNewConnectionWindow(this, new ConsoleProfile(), false);

            if (consoleProfile != null)
            {
                Settings.ConsoleProfiles.Add(consoleProfile);
                LoadConsoles();
            }
            else
            {
                foreach (object control in PanelConsoleProfiles.Controls)
                {
                    if (control is ConsoleItem item)
                    {
                        item.ShouldHover = true;
                    }
                }
            }
        }
Пример #2
0
        private void ButtonEdit_Click(object sender, EventArgs e)
        {
            int            selectedIndex     = Settings.ConsoleProfiles.IndexOf(ConsoleProfile);
            ConsoleProfile oldConsoleProfile = Settings.ConsoleProfiles[selectedIndex];

            ConsoleProfile newConsoleProfile = DialogExtensions.ShowNewConnectionWindow(this, oldConsoleProfile, true);

            oldConsoleProfile = newConsoleProfile;

            LoadConsoles();
        }
Пример #3
0
        private void ButtonAddNewConsole_Click(object sender, EventArgs e)
        {
            ConsoleProfile consoleProfile = DialogExtensions.ShowNewConnectionWindow(this, new ConsoleProfile(), false);

            if (consoleProfile != null)
            {
                Settings.ConsoleProfiles.Add(consoleProfile);
                MainWindow.Window.SaveSettings();
                MainWindow.Window.LoadSettings();
                LoadConsoles();
            }
        }
Пример #4
0
        private void ButtonEdit_Click(object sender, EventArgs e)
        {
            var selectedIndex     = MainWindow.Settings.ConsoleProfiles.IndexOf(ConsoleProfile);
            var oldConsoleProfile = MainWindow.Settings.ConsoleProfiles[selectedIndex];

            var newConsoleProfile = DialogExtensions.ShowNewConnectionWindow(this, oldConsoleProfile, true);

            if (newConsoleProfile != null)
            {
                oldConsoleProfile = newConsoleProfile;
            }

            LoadConsoles();
        }
Пример #5
0
        private void ButtonEditConsole_Click(object sender, EventArgs e)
        {
            try
            {
                if (MainWindow.IsConsoleConnected && MainWindow.ConsoleProfile == ConsoleProfile)
                {
                    XtraMessageBox.Show(this, "You can't edit the details because you're connected to the console.", "Console Connected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (ConsoleProfile != null)
                {
                    foreach (object control in PanelConsoleProfiles.Controls)
                    {
                        if (control is ConsoleItem item)
                        {
                            item.ShouldHover = false;
                        }
                    }

                    int            selectedIndex     = Settings.ConsoleProfiles.IndexOf(ConsoleProfile);
                    ConsoleProfile oldConsoleProfile = Settings.ConsoleProfiles[selectedIndex];

                    ConsoleProfile newConsoleProfile = DialogExtensions.ShowNewConnectionWindow(this, oldConsoleProfile, true);

                    Settings.ConsoleProfiles[selectedIndex] = newConsoleProfile;

                    SelectedItem = null;
                    LoadConsoles();
                }
            }
            catch (Exception ex)
            {
                Program.Log.Error(ex, "Error editing console.");
                XtraMessageBox.Show(this, "Error editing console.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }