コード例 #1
0
        private void EditQuestion_Click(object sender, RoutedEventArgs e)
        {
            string[]     q         = (((TextBlock)((StackPanel)((Button)sender).Parent).Children[0]).Text).Split('.');
            questionView questionV = new questionView(db, Convert.ToInt32(q[0]), false);

            questionV.ShowDialog();
            LoadQuestions();
        }
コード例 #2
0
 private void listbox_MouseDoubleClick(object sender, RoutedEventArgs e)
 {
     if (((StackPanel)((ListBox)sender).SelectedItem) != null)
     {
         if (((StackPanel)((ListBox)sender).SelectedItem).Name != "addQuestion")
         {
             string[]     q         = (((TextBlock)((StackPanel)((ListBox)sender).SelectedItem).Children[0]).Text).Split('.');
             questionView questionV = new questionView(db, Convert.ToInt32(q[0]), true);
             questionV.ShowDialog();
         }
         else
         {
             db.AddQuestion();
         }
         LoadQuestions();
     }
 }