Ejemplo n.º 1
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(MyAlias.Text))
     {
         Alias.DeleteAlias(_Hostname);
     }
     else
     {
         Alias.AddAlias(_Hostname, MyAlias.Text);
     }
     DialogResult = true;
 }
Ejemplo n.º 2
0
        private void Remove_Click(object sender, RoutedEventArgs e)
        {
            if (AliasesDataGrid.SelectedIndex < 0)
            {
                return;
            }

            var dialogWindow = new DialogWindow(
                DialogWindow.DialogIcon.Warning,
                Strings.DialogTitle_ConfirmDelete,
                $"{Strings.ManageAliases_Warn_DeleteA} {((KeyValuePair<string, string>)AliasesDataGrid.SelectedItem).Value} {Strings.ManageAliases_Warn_DeleteB}",
                Strings.DialogButton_Remove,
                true);

            dialogWindow.Owner = this;
            if (dialogWindow.ShowDialog() == true)
            {
                Alias.DeleteAlias(((KeyValuePair <string, string>)AliasesDataGrid.SelectedItem).Key);
                RefreshAliasList();
            }
        }
Ejemplo n.º 3
0
        private void Remove_Click(object sender, RoutedEventArgs e)
        {
            if (AliasesDataGrid.SelectedIndex < 0)
            {
                return;
            }

            var dialogWindow = new DialogWindow(
                DialogWindow.DialogIcon.Warning,
                "Confirm Delete",
                $"Are you sure you want to remove {((KeyValuePair<string, string>)AliasesDataGrid.SelectedItem).Value} from your aliases?",
                "Remove",
                true);

            dialogWindow.Owner = this;
            if (dialogWindow.ShowDialog() == true)
            {
                Alias.DeleteAlias(((KeyValuePair <string, string>)AliasesDataGrid.SelectedItem).Key);
                RefreshAliasList();
            }
        }