diff --git a/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs b/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs index ad287ca007..25fa2dcb52 100644 --- a/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs +++ b/Src/LexText/Interlinear/SandboxBase.ComboHandlers.cs @@ -14,6 +14,7 @@ using SIL.LCModel.Core.KernelInterfaces; using SIL.FieldWorks.Common.ViewsInterfaces; using SIL.FieldWorks.Common.FwUtils; +using static SIL.FieldWorks.Common.FwUtils.FwUtils; using SIL.FieldWorks.Common.Widgets; using SIL.LCModel; using SIL.LCModel.Application; @@ -2591,7 +2592,7 @@ private void OnSelectCreateNewEntry(object sender, EventArgs args) private void OnSelectEditLexicalEntry(object sender, EventArgs args) { ILexEntry lexEntry = GetLexEntry(); - m_sandbox.Mediator.SendMessage("JumpToPopupLexEntry", lexEntry.Hvo); + Publisher.Publish(new PublisherParameterObject(EventConstants.JumpToPopupLexEntry, lexEntry.Hvo)); } private ILexEntry GetLexEntry() diff --git a/Src/LexText/LexTextControls/InsertEntryDlg.cs b/Src/LexText/LexTextControls/InsertEntryDlg.cs index 4ba6010b6e..b73da52f54 100644 --- a/Src/LexText/LexTextControls/InsertEntryDlg.cs +++ b/Src/LexText/LexTextControls/InsertEntryDlg.cs @@ -17,6 +17,7 @@ using SIL.FieldWorks.Common.Controls; using SIL.LCModel.Core.KernelInterfaces; using SIL.FieldWorks.Common.FwUtils; +using static SIL.FieldWorks.Common.FwUtils.FwUtils; using SIL.FieldWorks.Common.RootSites; using SIL.FieldWorks.Common.Widgets; using SIL.LCModel; @@ -1349,7 +1350,7 @@ private void InsertEntryDlg_Closing(object sender, CancelEventArgs e) CreateNewEntry(); if (DialogResult == DialogResult.Retry) { - m_mediator.SendMessage("JumpToPopupLexEntry", m_entry.Hvo); + Publisher.Publish(new PublisherParameterObject(EventConstants.JumpToPopupLexEntry, m_entry.Hvo)); DialogResult = DialogResult.OK; } break; diff --git a/Src/xWorks/FwXWindow.cs b/Src/xWorks/FwXWindow.cs index 085b707ff2..482a4415d8 100644 --- a/Src/xWorks/FwXWindow.cs +++ b/Src/xWorks/FwXWindow.cs @@ -314,6 +314,7 @@ private void BasicInit(FwApp app) m_propertyTable.SetProperty("App", app, true); m_propertyTable.SetPropertyPersistence("App", false); } + Subscriber.Subscribe(EventConstants.JumpToPopupLexEntry, JumpToPopupLexEntry); } /// ------------------------------------------------------------------------------------ @@ -440,6 +441,8 @@ protected override void Dispose(bool disposing) if (disposing) { + Subscriber.Unsubscribe(EventConstants.JumpToPopupLexEntry, JumpToPopupLexEntry); + if (m_viewHelper != null) m_viewHelper.Dispose(); if (m_app != null) @@ -1214,7 +1217,7 @@ protected bool OnFileProjectProperties(object command) /// Create a popup window to edit the given lexical entry. /// /// ------------------------------------------------------------------------------------ - protected bool OnJumpToPopupLexEntry(object command) + private void JumpToPopupLexEntry(object command) { switch (m_propertyTable.GetStringProperty("currentContentControl", null)) { @@ -1224,7 +1227,7 @@ protected bool OnJumpToPopupLexEntry(object command) Mediator.BroadcastMessage("JumpToRecord", command); Mediator.BroadcastMessage("FocusFirstPossibleSlice", null); #pragma warning restore 618 - return true; + return; } XmlNode toolNode; @@ -1249,7 +1252,6 @@ protected bool OnJumpToPopupLexEntry(object command) Mediator.BroadcastMessage("FocusFirstPossibleSlice", null); #pragma warning restore 618 } - return true; } /// ------------------------------------------------------------------------------------