Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions Src/FdoUi/PhonologicalFeatureEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,25 +260,30 @@ private void m_tree_TreeLoad(object sender, EventArgs e)
{
if (m_PhonologicalFeatureTreeManager == null)
{
if (!String.IsNullOrEmpty(m_featDefnAbbr))
{
// Find the feature definition this editor was created to choose options from
var featDefns = from s in m_cache.LangProject.PhFeatureSystemOA.FeaturesOC
where s.Abbreviation.BestAnalysisAlternative.Text == m_featDefnAbbr
select s;
if (featDefns.Any())
m_closedFeature = featDefns.First() as IFsClosedFeature;
}

m_PhonologicalFeatureTreeManager = new PhonologicalFeaturePopupTreeManager(m_tree,
m_cache, false, m_mediator, PropTable,
PropTable.GetValue<Form>("window"),
m_displayWs, m_closedFeature);
m_PhonologicalFeatureTreeManager.AfterSelect += new TreeViewEventHandler(m_PhonFeaturePopupTreeManager_AfterSelect);
CreatePhonologicalFeatureTreeManager();
}
m_PhonologicalFeatureTreeManager.LoadPopupTree(0);
}

private void CreatePhonologicalFeatureTreeManager()
{
if (!String.IsNullOrEmpty(m_featDefnAbbr))
{
// Find the feature definition this editor was created to choose options from
var featDefns = from s in m_cache.LangProject.PhFeatureSystemOA.FeaturesOC
where s.Abbreviation.BestAnalysisAlternative.Text == m_featDefnAbbr
select s;
if (featDefns.Any())
m_closedFeature = featDefns.First() as IFsClosedFeature;
}

m_PhonologicalFeatureTreeManager = new PhonologicalFeaturePopupTreeManager(m_tree,
m_cache, false, m_mediator, PropTable,
PropTable.GetValue<Form>("window"),
m_displayWs, m_closedFeature);
m_PhonologicalFeatureTreeManager.AfterSelect += new TreeViewEventHandler(m_PhonFeaturePopupTreeManager_AfterSelect);
}

private void m_PhonFeaturePopupTreeManager_AfterSelect(object sender, TreeViewEventArgs e)
{
// Arrange to turn all relevant items blue.
Expand Down Expand Up @@ -422,6 +427,10 @@ private IFsFeatStruc GetTargetFsFeatStruc()
else if (obj is IFsSymFeatVal)
{
IFsSymFeatVal closedValue = (IFsSymFeatVal) obj;
if (m_PhonologicalFeatureTreeManager == null)
{
CreatePhonologicalFeatureTreeManager();
}
fsTarget = m_PhonologicalFeatureTreeManager.CreateEmptyFeatureStructureInAnnotation(obj);
var fsClosedValue = Cache.ServiceLocator.GetInstance<IFsClosedValueFactory>().Create();
fsTarget.FeatureSpecsOC.Add(fsClosedValue);
Expand Down
Loading