Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. using System.Xml.Linq;
  17. using System.Xml.Serialization;
  18. //using XMLControlLibrary;
  19.  
  20. namespace EJCTest
  21. {
  22. /// <summary>
  23. /// Interaction logic for MainWindow.xaml
  24. /// </summary>
  25. public partial class MainWindow : Window
  26. {
  27.  
  28. public MainWindow()
  29. {
  30. InitializeComponent();
  31. }
  32. // The offending method below.
  33. **private void xmlDataLoad()
  34. {
  35. string xmlPath = @"C:UsersJesseSourceReposAsyncSpeechSynthEJCTestXMLControlLibrarynewDictionary.xml";
  36. XDocument xdoc = XDocument.Load(xmlPath);
  37.  
  38. var eng = from wordList in xdoc.Root.Elements("Word")
  39. select wordList.Element("English").Value;
  40. engList.ItemsSource = eng.ToList();
  41.  
  42. var rom = from wordList in xdoc.Root.Elements("Word")
  43. select wordList.Element("Romaji").Value;
  44. romList.ItemsSource = rom.ToList();
  45.  
  46. var jpn = from wordList in xdoc.Root.Elements("Word")
  47. select wordList.Element("Japanese").Value;
  48. jpnList.ItemsSource = jpn.ToList();
  49. }**
  50.  
  51. private void Button_Click(object sender, RoutedEventArgs e)
  52. {
  53. xmlDataLoad();
  54. }
  55.  
  56. public class WordList
  57. {
  58. string english;
  59. string romaji;
  60. string japanese;
  61.  
  62. public string English
  63. {
  64. get { return english; }
  65. set { english = value; }
  66. }
  67.  
  68. public string Romaji
  69. {
  70. get { return romaji; }
  71. set { romaji = value; }
  72. }
  73.  
  74. public string Japanese
  75. {
  76. get { return japanese; }
  77. set { japanese = value; }
  78. }
  79. }
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement