private void AddKeywordExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            String res = InputDialogEx.ShowDialog("Add keyword", "Enter a keyword:");

            if (res != null)
            {
                lstKeywords.Items.Add(res);
            }
        }
        private void AddAuthorExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            String res = InputDialogEx.ShowDialog("Add author", "Enter a author name:");

            if (res != null)
            {
                lstAuthors.Items.Add(res);
            }
        }
        private void EditKeywordExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            String res = InputDialogEx.ShowDialog("Edit keyword", "Enter a new keyword:",
                                                  lstKeywords.SelectedItem.ToString());

            if (res != null)
            {
                int index = lstKeywords.SelectedIndex;
                lstKeywords.Items.Remove(lstKeywords.SelectedItem);
                lstKeywords.Items.Insert(index, res);
            }
        }
        private void EditAuthorExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            String res = InputDialogEx.ShowDialog("Edit author", "Enter a new author name:",
                                                  lstAuthors.SelectedItem.ToString());

            if (res != null)
            {
                int index = lstAuthors.SelectedIndex;
                lstAuthors.Items.Remove(lstAuthors.SelectedItem);
                lstAuthors.Items.Insert(index, res);
            }
        }
Пример #5
0
        private void button5_Click(object sender, RoutedEventArgs e)
        {
            String res = InputDialogEx.ShowDialog("Input", "Please enter a string:", "MyString", MessageIcons.None, activeBundle);

            if (res == null)
            {
                MessageDialogEx.ShowDialog("Cancel!", "Info", MessageButtons.OK, MessageIcons.Info, activeBundle);
            }
            else
            {
                MessageDialogEx.ShowDialog("String: " + res, "Info", MessageButtons.OK, MessageIcons.Info, activeBundle);
            }
        }