SIL.FieldWorks.LexText.Controls.MasterCategoryListDlg.LoadMasterCategories C# (CSharp) Method

LoadMasterCategories() private method

private LoadMasterCategories ( Set posSet ) : void
posSet Set
return void
		private void LoadMasterCategories(Set<IPartOfSpeech> posSet)
		{
			XmlDocument doc = new XmlDocument();
			doc.Load(Path.Combine(FwDirectoryFinder.TemplateDirectory, "GOLDEtic.xml"));
			XmlElement root = doc.DocumentElement;
			AddNodes(posSet, root.SelectNodes("/eticPOSList/item"), m_tvMasterList.Nodes, m_cache);

			// The expand/collapse cycle is to ensure that all the folder icons get set
			m_tvMasterList.ExpandAll();
			m_tvMasterList.CollapseAll();

			// Select the first node in the list
			TreeNode node = m_tvMasterList.Nodes[0];
			m_tvMasterList.SelectedNode = node;
			// Then try to find a root-level node that is not yet installed and select it if we
			// can, without moving the scrollbar (see LT-7441).
			do
			{
				if (!(node.Tag is MasterCategory))
					continue;
				if (!(node.Tag as MasterCategory).InDatabase)
					break;
				// DownArrow moves the selection without affecting the scroll position (unless
				// the selection was at the bottom).
				Win32.SendMessage(m_tvMasterList.Handle, Win32.WinMsgs.WM_KEYDOWN,
					(int)Keys.Down, 0);
			} while ((node = node.NextNode) != null);
		}