private void OpenFileHyperLink_Click(object sender, RoutedEventArgs e)
        {
            Hyperlink hyperlink = sender as Hyperlink;

            OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                Filter = "Fichier Studio des Langues Professeur|*.sdlp|Fichier Studio des Langues Elèves|*.sdle"
            };

            if (hyperlink.Tag as string == "Result")
            {
                openFileDialog.FilterIndex = 2;
            }

            if ((bool)openFileDialog.ShowDialog())
            {
                Hide();

                if (Path.GetExtension(openFileDialog.FileName) == ".sdlp")
                {
                    new MainWindow(ActivityPathParser.ParserInvert(openFileDialog.FileName), ref teacher).ShowDialog();
                }
                else if (Path.GetExtension(openFileDialog.FileName) == ".sdle")
                {
                    ActivityResult activityResult = ActivityResult.Open(openFileDialog.FileName);
                    new ResultViewer(activityResult).ShowDialog();
                }

                if (!isClosed)
                {
                    ShowDialog();
                }
            }
        }
Esempio n. 2
0
 private void OpenActivity() => ActivityInformations = ActivityPathParser.ParserInvert(activities[ActivitesListBox.SelectedIndex]);