public new static PartOfSpeechUi CreateNewUiObject(Mediator mediator, int classId, int hvoOwner, int flid, int insertionPosition)
{
PartOfSpeechUi posUi = null;
using (MasterCategoryListDlg dlg = new MasterCategoryListDlg())
{
FdoCache cache = (FdoCache)mediator.PropertyTable.GetValue("cache");
Debug.Assert(cache != null);
var newOwner = cache.ServiceLocator.GetInstance<IPartOfSpeechRepository>().GetObject(hvoOwner);
dlg.SetDlginfo(newOwner.OwningList, mediator, true, newOwner);
switch (dlg.ShowDialog((Form)mediator.PropertyTable.GetValue("window")))
{
case DialogResult.OK: // Fall through.
case DialogResult.Yes:
posUi = new PartOfSpeechUi(dlg.SelectedPOS);
mediator.SendMessage("JumpToRecord", dlg.SelectedPOS.Hvo);
break;
}
}
return posUi;
}