コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: ANEvdokimov/MyES
 private void UpdateWindow(MkbFile mkbFile)
 {
     DG_Questions.ItemsSource = null;
     DG_Questions.ItemsSource = mkbFile.Questions;
     DG_Result.ItemsSource    = null;
     DG_Result.ItemsSource    = mkbFile.Hypotheses;
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: ANEvdokimov/MyES
        private void OpenFile(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = "mkb files(*.mkb)|*.mkb|All files(*.*)|*.*"
            };

            if (!(bool)openFileDialog.ShowDialog())
            {
                return;
            }

            try
            {
                sourceMkbFile = MkbReader.ReadFile(openFileDialog.FileName);
            }
            catch (Exception exception)
            {
                Console.Write(exception.StackTrace);
                MessageBox.Show(exception.Message);
                return;
            }

            Title = "MyES - " + openFileDialog.FileName;
            Clear();
            DG_Questions.ItemsSource = sourceMkbFile.Questions;
            DG_Result.ItemsSource    = sourceMkbFile.Hypotheses;
            TB_Info.Text             = sourceMkbFile.InfoToString();

            Menu_MainMenu_Start.IsEnabled  = true;
            Menu_MainMenu_Cancel.IsEnabled = false;
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: ANEvdokimov/MyES
 private void Start(object sender, RoutedEventArgs e)
 {
     Menu_MainMenu_Start.IsEnabled  = false;
     Menu_MainMenu_Cancel.IsEnabled = true;
     BTN_Enter.IsEnabled            = true;
     mkbFile = (MkbFile)sourceMkbFile.Clone();
     TB_CurrentQuestion.Text = mkbFile.Questions[0].Text;
     numberQuestion          = 0;
 }