PopulateTreeFromFeatureStructure() public méthode

public PopulateTreeFromFeatureStructure ( IFsFeatStruc fs ) : void
fs IFsFeatStruc
Résultat void
Exemple #1
0
        /// <summary>
        /// Load the tree items if the starting point is a feature structure.
        /// </summary>
        /// <param name="fs"></param>
        protected virtual void LoadInflFeats(IFsFeatStruc fs)
        {
            var cobj = fs.Owner;

            switch (cobj.ClassID)
            {
            case MoAffixAllomorphTags.kClassId:
                PopulateTreeFromPosInEntry(cobj);
                break;

            default:
                // load inflectable features of this POS and any inflectable features of its parent POS
                var pos = GetOwningPOSOfFS(fs, cobj);
                PopulateTreeFromPos(pos);
                break;
            }
            m_tvMsaFeatureList.PopulateTreeFromFeatureStructure(fs);
            FinishLoading();
        }
        /// <summary>
        /// Load the tree items if the starting point is a feature structure.
        /// </summary>
        /// <param name="fs"></param>
        private void LoadInflFeats(IFsFeatStruc fs)
        {
            ICmObject cobj = CmObject.CreateFromDBObject(fs.Cache, fs.OwnerHVO);

            switch (cobj.ClassID)
            {
            case MoAffixAllomorph.kclsidMoAffixAllomorph:
                PopulateTreeFromPosInEntry(cobj);
                break;

            default:
                // load inflectable features of this POS and any inflectable features of its parent POS
                IPartOfSpeech pos = GetOwningPOSOfFS(fs, cobj);
                PopulateTreeFromPos(pos);
                break;
            }
            m_tvMsaFeatureList.PopulateTreeFromFeatureStructure(fs);
            FinishLoading();
        }
        private void LoadFeatureValuesIntoTreeview(FeatureStructureTreeView tv, IFsFeatStruc featStruct)
        {
            TreeNodeCollection col;

            tv.PopulateTreeFromFeatureStructure(featStruct);
            Assert.AreEqual(1, tv.Nodes.Count, "Count of top level after feature structure");
            col = tv.Nodes[0].Nodes;
            Assert.AreEqual(2, col.Count, "Count of first level nodes in tree view");
            foreach (TreeNode node in col)
            {
                TreeNodeCollection col2 = node.Nodes;
                if (node.Text == "gender")
                {
                    Assert.AreEqual(2, col2.Count, "Count of second level nodes in tree view");
                }
                if (node.Text == "person")
                {
                    Assert.AreEqual(1, col2.Count, "Count of second level nodes in tree view");
                }
            }
        }
		private void LoadFeatureValuesIntoTreeview(FeatureStructureTreeView tv, IFsFeatStruc featStruct)
		{
			TreeNodeCollection col;
			tv.PopulateTreeFromFeatureStructure(featStruct);
			Assert.AreEqual(1, tv.Nodes.Count, "Count of top level after feature structure");
			col = tv.Nodes[0].Nodes;
			Assert.AreEqual(2, col.Count, "Count of first level nodes in tree view");
			foreach (TreeNode node in col)
			{
				TreeNodeCollection col2 = node.Nodes;
				if (node.Text == "gender")
					Assert.AreEqual(2, col2.Count, "Count of second level nodes in tree view");
				if (node.Text == "person")
					Assert.AreEqual(1, col2.Count, "Count of second level nodes in tree view");
			}
		}