Exemplo n.º 1
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Syllabus syllabus = new Syllabus(openFileDialog.SafeFileName, openFileDialog.FileName);
                syllabi.Add(syllabus);
                SaveSyllabi(syllabi);
                PopulateSyllabi();
            }
        }
Exemplo n.º 2
0
        private void Open_Click(object sender, RoutedEventArgs e)
        {
            ListBoxItem item = SyllabiBox.SelectedItem as ListBoxItem;

            if (item != null)
            {
                Syllabus s = item.Content as Syllabus;
                if (s != null)
                {
                    System.Diagnostics.Process.Start(s.FilePath);
                }
            }
        }
Exemplo n.º 3
0
        private void Remove_Click(object sender, RoutedEventArgs e)
        {
            ListBoxItem item = SyllabiBox.SelectedItem as ListBoxItem;

            if (item != null)
            {
                Syllabus s = item.Content as Syllabus;
                if (s != null)
                {
                    syllabi.Remove(s);
                    SaveSyllabi(syllabi);
                    SyllabiBox.Items.Remove(item);
                    Open.IsEnabled = false;
                    PopulateSyllabi();
                }
            }
        }