Saturday, December 17, 2011

Determine if a WinForms control resource file is localized

  1. XPathDocument doc;
  2. using (var stream = File.OpenRead(fileName))
  3. {
  4. doc = new XPathDocument(stream);
  5. }
  6. var nav = doc.CreateNavigator();
  7. var itr = nav.Select("root/data[@name = '>>$this.Name']");
  8. var localized = itr.Count > 0;

No comments: