SIL.FieldWorks.FdoUi.LexPronunciationUi.CreateNewUiObject C# (CSharp) Method

CreateNewUiObject() public static method

Handle the context menu for inserting a LexPronunciation.
public static CreateNewUiObject ( XCore.Mediator mediator, int classId, int hvoOwner, int flid, int insertionPosition ) : LexPronunciationUi
mediator XCore.Mediator
classId int
hvoOwner int
flid int
insertionPosition int
return LexPronunciationUi
		public new static LexPronunciationUi CreateNewUiObject(Mediator mediator, int classId, int hvoOwner, int flid, int insertionPosition)
		{
			LexPronunciationUi result = null;
			FdoCache cache = (FdoCache)mediator.PropertyTable.GetValue("cache");
			UndoableUnitOfWorkHelper.Do(FdoUiStrings.ksUndoInsert, FdoUiStrings.ksRedoInsert, cache.ActionHandlerAccessor,
				() =>
			{
				int newHvo = cache.DomainDataByFlid.MakeNewObject(classId, hvoOwner, flid, insertionPosition);
				result = (LexPronunciationUi)MakeUi(cache, newHvo);
				// Forces them to be created (lest it try to happen while displaying the new object in PropChanged).
				var dummy = cache.LangProject.DefaultPronunciationWritingSystem;
			});
			return result;
		}
	}