TextInfoEntry.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Text;
  3. using System.Collections;
  4. using System.Xml;
  5. using System.Xml.XPath;
  6. namespace Mono.Tools.LocaleBuilder {
  7. public class TextInfoEntry : Entry {
  8. string ansi = "0";
  9. string ebcdic = "0";
  10. string mac = "0";
  11. string oem = "0";
  12. string listsep = ",";
  13. public TextInfoEntry (int lcid, XPathDocument d)
  14. {
  15. string q = "/textinfos/textinfo [@lcid=" + lcid + "]";
  16. XPathNodeIterator ni = (XPathNodeIterator) d.CreateNavigator ().Evaluate (q);
  17. // no info, move along
  18. if (! ni.MoveNext ())
  19. throw new Exception ();
  20. ansi = ni.Current.GetAttribute ("ansi", String.Empty);
  21. ebcdic = ni.Current.GetAttribute ("ebcdic", String.Empty);
  22. mac = ni.Current.GetAttribute ("mac", String.Empty);
  23. oem = ni.Current.GetAttribute ("oem", String.Empty);
  24. listsep = ni.Current.GetAttribute ("listsep", String.Empty);
  25. }
  26. public override string ToString ()
  27. {
  28. StringBuilder b = new StringBuilder ();
  29. b.Append ("{ ");
  30. b.Append (ansi);
  31. b.Append (", ");
  32. b.Append (ebcdic);
  33. b.Append (", ");
  34. b.Append (mac );
  35. b.Append (", ");
  36. b.Append (oem);
  37. b.Append (", '");
  38. b.Append (listsep);
  39. b.Append ("' }");
  40. return b.ToString ();
  41. }
  42. }
  43. }