public void Init() { treeViewGlossList = new GlossListTreeView(); treeViewGlossList.LoadGlossListTreeFromXml(sXmlFile, "en"); dom.Load(sXmlFile); }
private void InitForm() { // // Required for Windows Form Designer support // InitializeComponent(); SuspendLayout(); glossListBoxGloss.MGADialog = this; CancelButton = buttonCancel; // add the Info button buttonInfo.Text = MGAStrings.ksHideInfo; string sXmlFile = Path.Combine(FwDirectoryFinder.CodeDirectory, String.Format("Language Explorer{0}MGA{0}GlossLists{0}EticGlossList.xml", Path.DirectorySeparatorChar)); treeViewGlossListItem.LoadGlossListTreeFromXml(sXmlFile, m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Id); using (var graphics = CreateGraphics()) { float fRatio = graphics.DpiX / 96.0f; // try to adjust for screen resolution // on start-up, ensure the selected gloss panel is wide enough for all the buttons splitContainerVertical.SplitterDistance = splitContainerVertical.Width - (buttonAcceptGloss.Width + buttonCancel.Width + buttonHelp.Width + (int)(16 * fRatio)); Text += " " + m_cache.ProjectId.UiName; ResumeLayout(); } }
public void WritingSystemDefaultsToEnglishTest() { GlossListTreeView myTVGL = new GlossListTreeView(); // sXmlFile doesn't have any "fr" items in it; so it should default to English myTVGL.LoadGlossListTreeFromXml(sXmlFile, "fr"); Assert.IsTrue(myTVGL.WritingSystemAbbrev == "en", "Expected writing system to default to English, but it did not."); }