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
35 changes: 34 additions & 1 deletion Src/FdoUi/InflectionFeatureEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace SIL.FieldWorks.FdoUi
/// sort of makes sense to put it here as a class that is quite specific to a particular
/// part of the model.
/// </summary>
public class InflectionFeatureEditor : IBulkEditSpecControl, IDisposable
public class InflectionFeatureEditor : IBulkEditSpecControl, ITextChangedNotification, IDisposable
{
Mediator m_mediator;
TreeCombo m_tree;
Expand Down Expand Up @@ -662,5 +662,38 @@ private HashSet<int> GetPossiblePartsOfSpeech()
}
return possiblePOS;
}

public void ControlTextChanged()
{
// Look for fs named m_tree.Text in ReferenceFormsOC.
// Don't look in IFsFeatStrucRepository.
int count = 0;
foreach (var pos in Cache.LangProject.AllPartsOfSpeech)
{
foreach (var fs in pos.ReferenceFormsOC)
{
if (fs.ShortName == m_tree.Text)
{
m_selectedHvo = fs.Hvo;
m_selectedLabel = m_tree.Text;
count += 1;
}
}
}
if (count > 1)
{
// Two parts of speech have the same feature structure.
// Make the user choose which one they want.
m_selectedHvo = 0;
m_selectedLabel = "";
m_tree.Text = "";
}
if (count == 0)
{
// Couldn't find the feature structure.
// Make the user choose.
m_tree.Text = "";
}
}
}
}
Loading