Exemplo n.º 1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            this.exerciseCollection.Clear();

            string dataFolder = DataMgr.Instance.DataFolder;

            dataFolder = System.IO.Path.Combine(dataFolder, "Exercise");

            if (!System.IO.Directory.Exists(dataFolder))
            {
                System.IO.Directory.CreateDirectory(dataFolder);
            }

            string[] files = System.IO.Directory.GetFiles(dataFolder, "*.mxd");
            foreach (string file in files)
            {
                try
                {
                    Exercise exercise = SerializerHelper <Exercise> .XmlDeserialize(file);

                    exerciseCollection.Add(ExerciseHistoryData.FromExercise(exercise, file));
                }
                catch
                {
                }
            }
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            this.exerciseCollection.Clear();

            Assembly assembly   = Assembly.GetExecutingAssembly();
            string   dataFolder = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(assembly.Location), string.Format(@"Data\Math\{0}\{1}",
                                                                                                                           DataMgr.Instance.ActiveMathBasicType,
                                                                                                                           DataMgr.Instance.ActiveMathSubTypeItem.Type));

            if (!System.IO.Directory.Exists(dataFolder))
            {
                System.IO.Directory.CreateDirectory(dataFolder);
            }

            string[] files = System.IO.Directory.GetFiles(dataFolder, "*.mxd");
            foreach (string file in files)
            {
                try
                {
                    Exercise exercise = SerializerHelper <Exercise> .XmlDeserialize(file);

                    exerciseCollection.Add(ExerciseHistoryData.FromExercise(exercise, file));
                }
                catch
                {
                }
            }
        }
Exemplo n.º 3
0
        private void MessageWindowCallback(bool ok)
        {
            if (!ok)
            {
                return;
            }

            ExerciseHistoryData data = this.exerciseListView.SelectedItem as ExerciseHistoryData;

            try
            {
                System.IO.File.Delete(data.File);
            }
            catch
            {
            }

            this.exerciseCollection.Remove(data);
        }
Exemplo n.º 4
0
        private void viewDetailButton_Click(object sender, RoutedEventArgs e)
        {
            ExerciseHistoryData data = this.exerciseListView.SelectedItem as ExerciseHistoryData;

            ControlMgr.Instance.StartupUserControl.ShowAllQuestionPage(data.Exercise, false);
        }