Ejemplo n.º 1
0
        private void ConsoleItem_Click(object sender, EventArgs e)
        {
            ResetConsoleItems();

            Control SelectedItem;

            if (((Control)sender) is not TileConsoleItem)
            {
                SelectedItem = ((Control)sender).Parent;
            }
            else
            {
                SelectedItem = (Control)sender as TileConsoleItem;
            }

            SelectedConsole            = SelectedItem as TileConsoleItem;
            SelectedConsole.IsSelected = true;

            ConsoleProfile = SelectedConsole.ConsoleProfile;

            ButtonEdit.Enabled    = ConsoleProfile != null;
            ButtonDelete.Enabled  = ConsoleProfile != null;
            ButtonConnect.Enabled = ConsoleProfile != null;

            if (ConsoleProfile != null)
            {
                ButtonConnect.Focus();
            }
        }
Ejemplo n.º 2
0
        private void ListViewConsoleProfiles_SelectedIndicesChanged(object sender, EventArgs e)
        {
            ButtonEdit.Enabled    = ListViewConsoleProfiles.SelectedIndices.Count > 0;
            ButtonDelete.Enabled  = ListViewConsoleProfiles.SelectedIndices.Count > 0;
            ButtonConnect.Enabled = ListViewConsoleProfiles.SelectedIndices.Count > 0;

            if (ListViewConsoleProfiles.SelectedIndices.Count > 0)
            {
                _ = ButtonConnect.Focus();
            }
        }
Ejemplo n.º 3
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            await Users.Load();

            users            = new UserViewModel(Users.Items);
            this.DataContext = users;

            if (users.SelectedIndex == -1)
            {
                ButtonDelete.IsEnabled = false; ButtonNew.IsEnabled = false;
            }

            CheckBoxSaveUser.IsChecked           = AppSettings.Get("App", "SaveUserinfo", true);
            CheckBoxSaveUser.Click              += new RoutedEventHandler(CheckBoxSaveUser_Click);
            CheckBoxSavePass.Click              += new RoutedEventHandler(CheckBoxSavePass_Click);
            TextBoxHost.TextChanged             += new TextChangedEventHandler(TextBoxHost_TextChanged);
            ComboBoxEncryption.SelectionChanged += new SelectionChangedEventHandler(ComboBoxEncryption_SelectionChanged);

            this.IsEnabled = true;

            ButtonConnect.Focus();
        }