Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using System.Xml.Linq;
- using System.Xml.Serialization;
- //using XMLControlLibrary;
- namespace EJCTest
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- // The offending method below.
- **private void xmlDataLoad()
- {
- string xmlPath = @"C:UsersJesseSourceReposAsyncSpeechSynthEJCTestXMLControlLibrarynewDictionary.xml";
- XDocument xdoc = XDocument.Load(xmlPath);
- var eng = from wordList in xdoc.Root.Elements("Word")
- select wordList.Element("English").Value;
- engList.ItemsSource = eng.ToList();
- var rom = from wordList in xdoc.Root.Elements("Word")
- select wordList.Element("Romaji").Value;
- romList.ItemsSource = rom.ToList();
- var jpn = from wordList in xdoc.Root.Elements("Word")
- select wordList.Element("Japanese").Value;
- jpnList.ItemsSource = jpn.ToList();
- }**
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- xmlDataLoad();
- }
- public class WordList
- {
- string english;
- string romaji;
- string japanese;
- public string English
- {
- get { return english; }
- set { english = value; }
- }
- public string Romaji
- {
- get { return romaji; }
- set { romaji = value; }
- }
- public string Japanese
- {
- get { return japanese; }
- set { japanese = value; }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement