private SimpleListChooser MakeChooserWithExtantSlots(bool fIsPrefixSlot)
{
int slotFlid;
if (fIsPrefixSlot)
slotFlid = MoInflAffixTemplateTags.kflidPrefixSlots;
else
slotFlid = MoInflAffixTemplateTags.kflidSuffixSlots;
var labels = ObjectLabel.CreateObjectLabels(Cache, m_template.ReferenceTargetCandidates(slotFlid), null);
PersistenceProvider persistProvider =
new PersistenceProvider(m_mediator.PropertyTable);
SimpleListChooser chooser = new SimpleListChooser(persistProvider, labels,
m_ChooseSlotHelpTopic, m_mediator.HelpTopicProvider);
chooser.SetHelpTopic("khtpChoose-Grammar-InflAffixTemplateControl");
chooser.Cache = Cache;
chooser.TextParamHvo = m_template.Owner.Hvo;
chooser.Title = m_sSlotChooserTitle;
chooser.InstructionalText = m_sSlotChooserInstructionalText;
string sTopPOS;
var pos = GetHighestPOS(m_template.OwnerOfClass<IPartOfSpeech>(), out sTopPOS);
string sLabel = String.Format(m_sObligatorySlot, sTopPOS);
chooser.AddLink(sLabel, SimpleListChooser.LinkType.kSimpleLink,
new MakeInflAffixSlotChooserCommand(Cache, true, sLabel, pos.Hvo,
false, m_mediator));
sLabel = String.Format(m_sOptionalSlot, sTopPOS);
chooser.AddLink(sLabel, SimpleListChooser.LinkType.kSimpleLink,
new MakeInflAffixSlotChooserCommand(Cache, true, sLabel, pos.Hvo, true,
m_mediator));
chooser.SetObjectAndFlid(pos.Hvo, MoInflAffixTemplateTags.kflidSlots);
return chooser;
}