diff --git a/Src/Common/Controls/DetailControls/StringSlice.cs b/Src/Common/Controls/DetailControls/StringSlice.cs index 8f42acf794..6f2f092c85 100644 --- a/Src/Common/Controls/DetailControls/StringSlice.cs +++ b/Src/Common/Controls/DetailControls/StringSlice.cs @@ -333,8 +333,10 @@ public override void DoHotLinkAction(string strData, ISilDataAccess sda) { FwLinkArgs linkArgs = new FwLinkArgs(url); linkArgs.DisplayErrorMsg = false; +#pragma warning disable 618 // suppress obsolete warning if (m_mediator.SendMessage("FollowLink", linkArgs)) return; +#pragma warning restore 618 } } catch diff --git a/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs b/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs index d95b126a8e..2c18ba0d38 100644 --- a/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs +++ b/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs @@ -1730,8 +1730,10 @@ public override void DoHotLinkAction(string strData, ISilDataAccess sda) { FwLinkArgs linkArgs = new FwLinkArgs(url); linkArgs.DisplayErrorMsg = false; +#pragma warning disable 618 // suppress obsolete warning if (m_xbv.Mediator.SendMessage("FollowLink", linkArgs)) return; +#pragma warning restore 618 } } catch diff --git a/Src/FdoUi/FdoUiCore.cs b/Src/FdoUi/FdoUiCore.cs index 7bc60f3b97..207fea125a 100644 --- a/Src/FdoUi/FdoUiCore.cs +++ b/Src/FdoUi/FdoUiCore.cs @@ -1021,7 +1021,9 @@ public bool DeleteUnderlyingObject() object command = this; if (m_command != null) command = m_command; +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("DeleteRecord", command); +#pragma warning restore 618 } else { @@ -1161,7 +1163,9 @@ public void MergeUnderlyingObject(bool fLoseNoTextData) { ReallyMergeUnderlyingObject(dlg.Hvo, fLoseNoTextData); // Refresh in case "Sense Number" was 0 in the target and non-0 in the source (LT-22155). +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 } } } diff --git a/Src/FdoUi/FsFeatDefnUi.cs b/Src/FdoUi/FsFeatDefnUi.cs index fbac5f1092..9b664b21e5 100644 --- a/Src/FdoUi/FsFeatDefnUi.cs +++ b/Src/FdoUi/FsFeatDefnUi.cs @@ -53,7 +53,9 @@ internal FsFeatDefnUi() {} case DialogResult.OK: // Fall through. case DialogResult.Yes: ffdUi = new FsFeatDefnUi(dlg.SelectedFeatDefn); +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("JumpToRecord", dlg.SelectedFeatDefn.Hvo); +#pragma warning restore 618 break; } } diff --git a/Src/FdoUi/PartOfSpeechUi.cs b/Src/FdoUi/PartOfSpeechUi.cs index 201914f6c3..5a92b290c8 100644 --- a/Src/FdoUi/PartOfSpeechUi.cs +++ b/Src/FdoUi/PartOfSpeechUi.cs @@ -52,7 +52,9 @@ internal PartOfSpeechUi() { } case DialogResult.OK: // Fall through. case DialogResult.Yes: posUi = new PartOfSpeechUi(dlg.SelectedPOS); +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("JumpToRecord", dlg.SelectedPOS.Hvo); +#pragma warning restore 618 break; } } diff --git a/Src/LexText/Interlinear/InterlinearImportDlg.cs b/Src/LexText/Interlinear/InterlinearImportDlg.cs index c32616fcf6..5823b6e165 100644 --- a/Src/LexText/Interlinear/InterlinearImportDlg.cs +++ b/Src/LexText/Interlinear/InterlinearImportDlg.cs @@ -79,7 +79,9 @@ private void m_btnOK_Click(object sender, EventArgs e) var firstNewText = import.FirstNewText; if (firstNewText != null && m_mediator != null) { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("JumpToRecord", firstNewText.Hvo); +#pragma warning restore 618 } } else diff --git a/Src/LexText/Interlinear/InterlinearSfmImportWizard.cs b/Src/LexText/Interlinear/InterlinearSfmImportWizard.cs index 81c3a8c6ce..0622762625 100644 --- a/Src/LexText/Interlinear/InterlinearSfmImportWizard.cs +++ b/Src/LexText/Interlinear/InterlinearSfmImportWizard.cs @@ -586,7 +586,9 @@ protected override void OnFinishButton() Close(); } } +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", ActiveForm); +#pragma warning restore 618 if (m_firstNewText != null) { // try to select it. diff --git a/Src/LexText/Interlinear/InterlinearTextsRecordClerk.cs b/Src/LexText/Interlinear/InterlinearTextsRecordClerk.cs index 61b9c53cfa..9b4455be15 100644 --- a/Src/LexText/Interlinear/InterlinearTextsRecordClerk.cs +++ b/Src/LexText/Interlinear/InterlinearTextsRecordClerk.cs @@ -256,7 +256,11 @@ private bool AddNewText(Command command) if (CurrentObject == null || CurrentObject.Hvo == 0) return false; if (!InDesiredTool("interlinearEdit")) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("FollowLink", new FwLinkArgs("interlinearEdit", CurrentObject.Guid)); +#pragma warning restore 618 + } // This is a workable alternative (where link is the one created above), but means this code has to know about the FwXApp class. //(FwXApp.App as FwXApp).OnIncomingLink(link); // This alternative does NOT work; it produces a deadlock...I think the remote code is waiting for the target app diff --git a/Src/LexText/Interlinear/TextsFilterItem.cs b/Src/LexText/Interlinear/TextsFilterItem.cs index 1b4e32eade..91ae15e78a 100644 --- a/Src/LexText/Interlinear/TextsFilterItem.cs +++ b/Src/LexText/Interlinear/TextsFilterItem.cs @@ -25,7 +25,9 @@ public TextsFilterItem(ITsString tssName, LcmCache cache, Mediator mediator) : b public override bool Invoke() { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("AddTexts", this); +#pragma warning restore 618 //var clerk = RecordClerk.FindClerk(m_mediator, "interlinearTexts") as InterlinearTextsRecordClerk; //if (clerk == null) diff --git a/Src/LexText/LexTextControls/EntryDlgListener.cs b/Src/LexText/LexTextControls/EntryDlgListener.cs index 97e3c679c6..d7c31e7de2 100644 --- a/Src/LexText/LexTextControls/EntryDlgListener.cs +++ b/Src/LexText/LexTextControls/EntryDlgListener.cs @@ -66,8 +66,10 @@ public bool OnDialogInsertItemInVector(object argument) bool newby; dlg.GetDialogInfo(out entry, out newby); // No need for a PropChanged here because InsertEntryDlg takes care of that. (LT-3608) +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); m_mediator.SendMessage("JumpToRecord", entry.Hvo); +#pragma warning restore 618 } } return true; // We "handled" the message, regardless of what happened. @@ -146,7 +148,9 @@ private bool RunMergeEntryDialog(object argument, bool fLoseNoTextData) LexTextControls.ksEntriesHaveBeenMerged, LexTextControls.ksMergeReport, MessageBoxButtons.OK, MessageBoxIcon.Information); +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("JumpToRecord", survivor.Hvo); +#pragma warning restore 618 } } return true; diff --git a/Src/LexText/LexTextControls/LexOptionsDlg.cs b/Src/LexText/LexTextControls/LexOptionsDlg.cs index edecb8d40f..993940e631 100644 --- a/Src/LexText/LexTextControls/LexOptionsDlg.cs +++ b/Src/LexText/LexTextControls/LexOptionsDlg.cs @@ -233,7 +233,11 @@ private void m_btnOK_Click(object sender, EventArgs e) var managerNode = managerDoc.SelectSingleNode("/manager"); var shutdownMsg = XmlUtils.GetOptionalAttributeValue(managerNode, "shutdown"); if (!string.IsNullOrEmpty(shutdownMsg)) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage(shutdownMsg, null); +#pragma warning restore 618 + } var configfilesNode = managerNode.SelectSingleNode("configfiles"); var extensionPath = Path.Combine(baseExtensionPath, configfilesNode.Attributes["targetdir"].Value); Directory.Delete(extensionPath, true); diff --git a/Src/LexText/LexTextControls/RecordDlgListener.cs b/Src/LexText/LexTextControls/RecordDlgListener.cs index 9e56ea35df..0cb4a8145f 100644 --- a/Src/LexText/LexTextControls/RecordDlgListener.cs +++ b/Src/LexText/LexTextControls/RecordDlgListener.cs @@ -69,7 +69,9 @@ public bool OnDialogInsertItemInVector(object argument) if (dlg.ShowDialog(Form.ActiveForm) == DialogResult.OK) { IRnGenericRec newRec = dlg.NewRecord; +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("JumpToRecord", newRec.Hvo); +#pragma warning restore 618 } } return true; // We "handled" the message, regardless of what happened. diff --git a/Src/LexText/LexTextDll/LexTextApp.cs b/Src/LexText/LexTextDll/LexTextApp.cs index 62ea6716cd..1a95be4931 100644 --- a/Src/LexText/LexTextDll/LexTextApp.cs +++ b/Src/LexText/LexTextDll/LexTextApp.cs @@ -419,7 +419,9 @@ dlg is LexImportWizard || dlg is NotebookImportWiz || dlg is LiftImportDlg || dlg is CombineImportDlg) { // Make everything we've imported visible. +#pragma warning disable 618 // suppress obsolete warning wndActive.Mediator.SendMessage("MasterRefresh", wndActive); +#pragma warning restore 618 } } } diff --git a/Src/LexText/Lexicon/LexReferenceMultiSlice.cs b/Src/LexText/Lexicon/LexReferenceMultiSlice.cs index a9c6d738b6..e2de013af3 100644 --- a/Src/LexText/Lexicon/LexReferenceMultiSlice.cs +++ b/Src/LexText/Lexicon/LexReferenceMultiSlice.cs @@ -756,7 +756,9 @@ public void HandleMoreMenuItem(object sender, EventArgs ea) ILexRefType newKid = list.Services.GetInstance().Create(); list.PossibilitiesOS.Add(newKid); m_cache.DomainDataByFlid.EndUndoTask(); +#pragma warning disable 618 // suppress obsolete warning ContainingDataTree.Mediator.SendMessage("FollowLink", new FwLinkArgs("lexRefEdit", newKid.Guid)); +#pragma warning restore 618 } protected void ExpandNewNode() diff --git a/Src/LexText/Lexicon/ReversalListener.cs b/Src/LexText/Lexicon/ReversalListener.cs index c8ae34bc38..6d046ddc96 100644 --- a/Src/LexText/Lexicon/ReversalListener.cs +++ b/Src/LexText/Lexicon/ReversalListener.cs @@ -731,7 +731,9 @@ protected virtual void ReallyDeleteReversalIndex(IReversalIndex ri) } // Without this, stale data can still display in the BulkEditSenses tool if you // recreate the deleted reversal index. +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 } internal static IReversalIndex ReversalIndexAfterDeletion(LcmCache cache, out int cobjNew) diff --git a/Src/LexText/Morphology/InflAffixTemplateMenuHandler.cs b/Src/LexText/Morphology/InflAffixTemplateMenuHandler.cs index 46fa961190..af070d2cea 100644 --- a/Src/LexText/Morphology/InflAffixTemplateMenuHandler.cs +++ b/Src/LexText/Morphology/InflAffixTemplateMenuHandler.cs @@ -359,7 +359,9 @@ internal virtual void HandleFwMenuSelection(object sender, EventArgs ea) if (fmi == null) return; var command = new Command(m_mediator, fmi.ConfigurationNode); +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage(fmi.Message, command); +#pragma warning restore 618 } private FwMenuItem FindEnabledItem(int iSel) diff --git a/Src/LexText/Morphology/MasterInflFeatDlgListener.cs b/Src/LexText/Morphology/MasterInflFeatDlgListener.cs index 15e196ebde..34629c7893 100644 --- a/Src/LexText/Morphology/MasterInflFeatDlgListener.cs +++ b/Src/LexText/Morphology/MasterInflFeatDlgListener.cs @@ -95,7 +95,9 @@ public override bool OnDialogInsertItemInVector(object argument) // this call, so there is code in the Mediator to handle in the middle of a msg the case // where the object is nolonger valid. This has happend before and was being handled, this // call "SendMessageToAllNow" has not had the code to handle the exception, so it was added. +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessageToAllNow("MasterRefresh", cache.LangProject.MsFeatureSystemOA); +#pragma warning restore 618 break; } } diff --git a/Src/LexText/Morphology/MasterPhonFeatDlgListener.cs b/Src/LexText/Morphology/MasterPhonFeatDlgListener.cs index 8d47de4125..07d5c1f419 100644 --- a/Src/LexText/Morphology/MasterPhonFeatDlgListener.cs +++ b/Src/LexText/Morphology/MasterPhonFeatDlgListener.cs @@ -112,7 +112,9 @@ public override bool OnDialogInsertItemInVector(object argument) // this call, so there is code in the Mediator to handle in the middle of a msg the case // where the object is nolonger valid. This has happend before and was being handled, this // call "SendMessageToAllNow" has not had the code to handle the exception, so it was added. +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessageToAllNow("MasterRefresh", cache.LangProject.PhFeatureSystemOA); +#pragma warning restore 618 break; } } diff --git a/Src/LexText/Morphology/RespellerDlg.cs b/Src/LexText/Morphology/RespellerDlg.cs index ea100fde50..03b7397f59 100644 --- a/Src/LexText/Morphology/RespellerDlg.cs +++ b/Src/LexText/Morphology/RespellerDlg.cs @@ -518,7 +518,9 @@ private void m_btnClose_Click(object sender, EventArgs e) { if (ChangesWereMade) { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 } Close(); } @@ -569,7 +571,9 @@ private void m_btnApply_Click(object sender, EventArgs e) // On the other hand, we don't want to update the new wordform until after DoIt...it might not exist before, // and we won't be messing up any existing occurrences. +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("ItemDataModified", m_cache.ServiceLocator.GetObject(m_respellUndoaction.NewWordform)); +#pragma warning restore 618 ChangesWereMade = true; @@ -1534,11 +1538,15 @@ private void CoreDoIt(ProgressDialogWorkingOn progress, Mediator mediator) } else { +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("ItemDataModified", wfOld); +#pragma warning restore 618 } } +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("ItemDataModified", wfNew); +#pragma warning restore 618 uuow.RollBack = false; } diff --git a/Src/LexText/ParserUI/ParserListener.cs b/Src/LexText/ParserUI/ParserListener.cs index 2e59ac8cf6..2227eaada6 100644 --- a/Src/LexText/ParserUI/ParserListener.cs +++ b/Src/LexText/ParserUI/ParserListener.cs @@ -232,7 +232,11 @@ private void UpdateStatusPanelProgress() { string notification = m_parserConnection.GetAndClearNotification(); if (notification != null) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("ShowNotification", notification); +#pragma warning restore 618 + } } } if (ParserActivityString == ParserUIStrings.ksIdle_ && m_timer.Enabled) diff --git a/Src/LexText/ParserUI/ParserReportDialog.xaml.cs b/Src/LexText/ParserUI/ParserReportDialog.xaml.cs index d011336e9d..cd74b27323 100644 --- a/Src/LexText/ParserUI/ParserReportDialog.xaml.cs +++ b/Src/LexText/ParserUI/ParserReportDialog.xaml.cs @@ -59,7 +59,9 @@ public void ReparseWord(object sender, RoutedEventArgs e) { var button = sender as Button; var parseReport = button.CommandParameter as ParseReport; +#pragma warning disable 618 // suppress obsolete warning Mediator.SendMessage("TryThisWord", RemoveArrow(parseReport.Word)); +#pragma warning restore 618 } public void ShowWordAnalyses(object sender, RoutedEventArgs e) diff --git a/Src/XCore/xCoreInterfaces/BaseContextHelper.cs b/Src/XCore/xCoreInterfaces/BaseContextHelper.cs index 6417ef5299..8f493745c8 100644 --- a/Src/XCore/xCoreInterfaces/BaseContextHelper.cs +++ b/Src/XCore/xCoreInterfaces/BaseContextHelper.cs @@ -245,7 +245,9 @@ private bool GetHelpText (string id, ref string caption, out string text) { var holder = new ToolTipHolder(); holder.ToolTip = text; +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage(command.MessageString + "ToolTip", holder); +#pragma warning restore 618 text = holder.ToolTip; } } diff --git a/Src/XCore/xCoreInterfaces/Choice.cs b/Src/XCore/xCoreInterfaces/Choice.cs index b2095d57b0..9dd9fb4ef8 100644 --- a/Src/XCore/xCoreInterfaces/Choice.cs +++ b/Src/XCore/xCoreInterfaces/Choice.cs @@ -273,7 +273,9 @@ private static UIItemDisplayProperties QueryDisplayProperties(ChoiceGroup group, //OK, this is a little non-obvious //first we allow anyone who knows about this specific command to influence how it is displayed //why was it this way? m_mediator.SendMessage("Display"+this.m_idOfCorrespondingCommand, CommandObject, ref display); +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("Display" + command.Id, command, ref display); +#pragma warning restore 618 //but then, we also allow anyone who knows about this specific message that would be sent @@ -283,7 +285,9 @@ private static UIItemDisplayProperties QueryDisplayProperties(ChoiceGroup group, //And in this case, there may not be any actual code which knows about one of these commands, //instead the code may be written to just listen for the "InsertRecord" message and then act //upon its arguments which, in this example, would cause it to either insert a person or a company. +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("Display" + command.MessageString, command, ref display); +#pragma warning restore 618 return display; } @@ -396,7 +400,9 @@ override public UIItemDisplayProperties GetDisplayProperties() // known group are those starting with ShowHiddenFields-), partly because they occur in settings // files as well as the program. So we change any hyphens to underscore so that it's actually possible // to implement the method that this code is looking for. +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("Display" + BoolPropertyName.Replace('-', '_'), null, ref display); +#pragma warning restore 618 if (display.Text.StartsWith("$")) { int iOfEquals = display.Text.IndexOf("="); @@ -506,7 +512,9 @@ override public UIItemDisplayProperties GetDisplayProperties() { UIItemDisplayProperties display = new UIItemDisplayProperties(m_parent, Label, m_defaultVisible, ImageName, m_defaultVisible); display.Checked = Checked; +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("Display"+ PropertyName, null, ref display); +#pragma warning restore 618 return display; } diff --git a/Src/XCore/xCoreInterfaces/ChoiceGroup.cs b/Src/XCore/xCoreInterfaces/ChoiceGroup.cs index 8d56213f86..115c6ec360 100644 --- a/Src/XCore/xCoreInterfaces/ChoiceGroup.cs +++ b/Src/XCore/xCoreInterfaces/ChoiceGroup.cs @@ -409,10 +409,12 @@ override public UIItemDisplayProperties GetDisplayProperties() // enabled items would be 'visible' and enabled was true by default. UIItemDisplayProperties display =new UIItemDisplayProperties(this, this.Label, this.m_defaultVisible, ImageName, this.m_defaultVisible); +#pragma warning disable 618 // suppress obsolete warning if (this.PropertyName != null && this.PropertyName != string.Empty) m_mediator.SendMessage("Display"+this.PropertyName, null, ref display); else m_mediator.SendMessage("Display"+this.Id, null, ref display); +#pragma warning restore 618 return display; } @@ -466,7 +468,9 @@ protected void PopulateFromList() UIListDisplayProperties display = new UIListDisplayProperties(list); display.PropertyName = PropertyName; string wsSet = XmlUtils.GetOptionalAttributeValue(m_configurationNode, "wsSet"); +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("Display"+ ListId, wsSet, ref display); +#pragma warning restore 618 PropertyName = display.PropertyName; @@ -651,7 +655,9 @@ private string CommandMessage /// private void HandleClickedWhenCommand(ListPropertyChoice choice) { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage(CommandMessage, choice.ParameterNode); +#pragma warning restore 618 } protected bool IsAListGroup diff --git a/Src/XCore/xCoreInterfaces/Command.cs b/Src/XCore/xCoreInterfaces/Command.cs index 28909bf18a..79196451cc 100644 --- a/Src/XCore/xCoreInterfaces/Command.cs +++ b/Src/XCore/xCoreInterfaces/Command.cs @@ -750,7 +750,9 @@ public void InvokeCommand() using (new WaitCursor(Form.ActiveForm)) { Logger.WriteEvent("Start: " + msgString); +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage(msgString, this); +#pragma warning restore 618 Logger.WriteEvent("Done: " + msgString); } } diff --git a/Src/XCore/xCoreInterfaces/Mediator.cs b/Src/XCore/xCoreInterfaces/Mediator.cs index 74c633bd8b..49bce7b250 100644 --- a/Src/XCore/xCoreInterfaces/Mediator.cs +++ b/Src/XCore/xCoreInterfaces/Mediator.cs @@ -779,6 +779,8 @@ public void BroadcastString(string methodName, string stringParam) /// /// true if the message was handled, otherwise false /// ------------------------------------------------------------------------------------ + [Obsolete("Use the the FwUtils Publisher and Subscriber classes instead.", false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool SendMessage(string messageName, object parameter) { CheckDisposed(); @@ -792,7 +794,7 @@ public bool SendMessage(string messageName, object parameter) /// Have seen a stack situation that the Mediator has been disposed of after returning from this call... /// - result = SendMessage(messageName, parameter, true); + result = SendMessageWorker(messageName, parameter); } catch (DisposedInAnotherFrameException) { @@ -804,15 +806,11 @@ public bool SendMessage(string messageName, object parameter) /// ------------------------------------------------------------------------------------ /// - /// This version is used to invoke commands + /// Worker method to invoke commands. It will log the call if it is not an update or idle. /// - /// - /// - /// True to log the call (if its not an update or idle), false - /// otherwise /// true if the message was handled, otherwise false /// ------------------------------------------------------------------------------------ - public bool SendMessage(string messageName, object parameter, bool fLogIt) + private bool SendMessageWorker(string messageName, object parameter) { CheckDisposed(); @@ -831,7 +829,7 @@ public bool SendMessage(string messageName, object parameter, bool fLogIt) } string methodName = "On" + messageName; // Logging - if (!messageName.StartsWith("Update") && messageName != "Idle" && fLogIt) + if (!messageName.StartsWith("Update") && messageName != "Idle") { // We want to log the method if any colleague handles it. // So we check the list of methods known-to-us first. If we don't find it, @@ -866,6 +864,8 @@ public bool SendMessage(string messageName, object parameter, bool fLogIt) /// /// /// ------------------------------------------------------------------------------------ + [Obsolete("Use the the FwUtils Publisher and Subscriber classes instead.", false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public void SendMessage(string messageName, object parameter, ref UIItemDisplayProperties returnValue) { @@ -901,6 +901,8 @@ public void SendMessage(string messageName, object parameter, /// /// /// + [Obsolete("Use the the FwUtils Publisher and Subscriber classes instead.", false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public void SendMessage(string messageName, object parameter, ref UIListDisplayProperties returnValue) { @@ -939,6 +941,8 @@ public void SendMessage(string messageName, object parameter, /// /// /// true if one or more colleagues handled the message, else false + [Obsolete("Use the the FwUtils Publisher and Subscriber classes instead.", false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool SendMessageToAllNow(string messageName, object parameter) { CheckDisposed(); @@ -1010,7 +1014,9 @@ public void PostMessage(string messageName, object parameter) private bool PostMessageOnIdle(object parameter) { var pmi = (PendingMessageItem) parameter; +#pragma warning disable 618 // suppress obsolete warning SendMessage(pmi.m_message, pmi.m_parameter); +#pragma warning restore 618 return true; } diff --git a/Src/XCore/xCoreInterfaces/xCoreInterfacesTests/TestMessageSequencer.cs b/Src/XCore/xCoreInterfaces/xCoreInterfacesTests/TestMessageSequencer.cs index 1bc84e48f0..9cb5ee8ab7 100644 --- a/Src/XCore/xCoreInterfaces/xCoreInterfacesTests/TestMessageSequencer.cs +++ b/Src/XCore/xCoreInterfaces/xCoreInterfacesTests/TestMessageSequencer.cs @@ -251,7 +251,9 @@ public void Prioritize() ArrayList testList = new ArrayList(); ArrayList expectedResult = new ArrayList() {"High", "Medium", "Low"}; +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("AddTestItem", testList); +#pragma warning restore 618 Assert.That(expectedResult, Is.EqualTo(testList), "Mediator message Prioritization is broken."); } } diff --git a/Src/XCore/xWindow.cs b/Src/XCore/xWindow.cs index d0ea5efe68..fedf8611ee 100644 --- a/Src/XCore/xWindow.cs +++ b/Src/XCore/xWindow.cs @@ -1803,7 +1803,9 @@ public void SynchronizedOnIdleTime() UpdateControls(); // call OnIdle () on any colleagues that implement it. +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("Idle", null); +#pragma warning restore 618 } /// diff --git a/Src/xWorks/DTMenuHandler.cs b/Src/xWorks/DTMenuHandler.cs index d9b6a0ef15..84d0bbd14c 100644 --- a/Src/xWorks/DTMenuHandler.cs +++ b/Src/xWorks/DTMenuHandler.cs @@ -626,7 +626,9 @@ private void POSPopupTreeManager_AfterSelect(object sender, System.Windows.Forms if (m_moveObj is IMoInflAffixSlot slot) { MoveSlot(slot, selectedPOS); +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 } if (m_moveObj is IMoInflAffixTemplate template) { diff --git a/Src/xWorks/DictionaryConfigurationListener.cs b/Src/xWorks/DictionaryConfigurationListener.cs index 9a04dc3ed8..b326f88783 100644 --- a/Src/xWorks/DictionaryConfigurationListener.cs +++ b/Src/xWorks/DictionaryConfigurationListener.cs @@ -227,7 +227,11 @@ public bool OnConfigureDictionary(object commandObject) refreshNeeded = controller.MasterRefreshRequired; } if (refreshNeeded) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 + } return true; // message handled } diff --git a/Src/xWorks/FwXApp.cs b/Src/xWorks/FwXApp.cs index 7d168da845..e2f092f060 100644 --- a/Src/xWorks/FwXApp.cs +++ b/Src/xWorks/FwXApp.cs @@ -199,7 +199,9 @@ public override void HandleIncomingLink(FwLinkArgs link) FwXWindow fwxwnd = m_rgMainWindows.Count > 0 ? (FwXWindow)m_rgMainWindows[0] : null; if (fwxwnd != null) { +#pragma warning disable 618 // suppress obsolete warning fwxwnd.Mediator.SendMessage("FollowLink", link); +#pragma warning restore 618 bool topmost = fwxwnd.TopMost; fwxwnd.TopMost = true; fwxwnd.TopMost = topmost; diff --git a/Src/xWorks/FwXWindow.cs b/Src/xWorks/FwXWindow.cs index ef98e02718..be386fcdb7 100644 --- a/Src/xWorks/FwXWindow.cs +++ b/Src/xWorks/FwXWindow.cs @@ -1620,7 +1620,9 @@ private void HandleUndoResult(UndoResult ures, bool fPrivate) // EricP/JohnT -- this path will probably never be called in a production // context, since we'll have an FwApp. And even in the case of tests // taking this path, we wonder if we should issue a "MasterRefresh" instead +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("Refresh", this); +#pragma warning restore 618 } } } @@ -2029,7 +2031,9 @@ public bool OnImportPhonology(object commandObject) var phonologyServices = new PhonologyServices(Cache); phonologyServices.DeletePhonology(); phonologyServices.ImportPhonologyFromXml(filename); +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 } catch (Exception ex) { @@ -2277,7 +2281,11 @@ public bool OnFinishedInit() } if (m_startupLink != null) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("FollowLink", m_startupLink); +#pragma warning restore 618 + } UpdateControls(); return true; } @@ -2402,7 +2410,9 @@ public void RefreshAllViews() CheckDisposed(); // We don't want to clear the cache... just update the view. +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("Refresh", this); +#pragma warning restore 618 //OnMasterRefresh(null); } diff --git a/Src/xWorks/LinkListener.cs b/Src/xWorks/LinkListener.cs index f7900abed7..a7ea5c0097 100644 --- a/Src/xWorks/LinkListener.cs +++ b/Src/xWorks/LinkListener.cs @@ -416,7 +416,9 @@ public bool OnTestFollowLink(object unused) CheckDisposed(); LcmCache cache = m_propertyTable.GetValue("cache"); Guid[] guids = (from entry in cache.LanguageProject.LexDbOA.Entries select entry.Guid).ToArray(); +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("FollowLink", new FwLinkArgs("lexiconEdit", guids[guids.Length - 1])); +#pragma warning restore 618 return true; } @@ -478,7 +480,9 @@ private bool FollowActiveLink(bool suspendLoadingRecord) // Thus we've created this method (on AreaListener) which we call awkwardly throught the mediator. var parameters = new object[2]; parameters[0] = majorObject; +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("GetToolForList", parameters); +#pragma warning restore 618 realTool = (string)parameters[1]; break; case RnResearchNbkTags.kClassId: diff --git a/Src/xWorks/RecordClerk.cs b/Src/xWorks/RecordClerk.cs index 0a88655f9d..01d76e8a93 100644 --- a/Src/xWorks/RecordClerk.cs +++ b/Src/xWorks/RecordClerk.cs @@ -1561,7 +1561,9 @@ public bool OnDeleteRecord(object commandObject) } } } +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 } } return true; //we handled this, no need to ask anyone else. @@ -2560,8 +2562,10 @@ public bool OnInsertItemInVector(object argument) m_suppressSaveOnChangeRecord = true; try { +#pragma warning disable 618 // suppress obsolete warning if (m_mediator.SendMessage("DialogInsertItemInVector", argument)) return true; +#pragma warning restore 618 } finally { diff --git a/Src/xWorks/RecordDocView.cs b/Src/xWorks/RecordDocView.cs index da9bc78fdb..09d4f8ca81 100644 --- a/Src/xWorks/RecordDocView.cs +++ b/Src/xWorks/RecordDocView.cs @@ -328,7 +328,11 @@ private void RunConfigureDialog(string nodePath) ResetTables(sNewLayout); } if (dlg.MasterRefreshRequired) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 + } } } @@ -515,7 +519,12 @@ public bool OnConfigureXmlDocView(object commandObject) } } if (dlg.MasterRefreshRequired) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 + } + return true; // we handled it } } diff --git a/Src/xWorks/XhtmlDocView.cs b/Src/xWorks/XhtmlDocView.cs index 226998e97c..849e62d2d8 100644 --- a/Src/xWorks/XhtmlDocView.cs +++ b/Src/xWorks/XhtmlDocView.cs @@ -621,7 +621,11 @@ private static void RunConfigureDialogAt(object sender, EventArgs e) refreshNeeded = controller.MasterRefreshRequired; } if (refreshNeeded) + { +#pragma warning disable 618 // suppress obsolete warning mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 + } } private static void RunDiagnosticsDialogAt(object sender, EventArgs e) diff --git a/Src/xWorks/XmlDocConfigureDlg.cs b/Src/xWorks/XmlDocConfigureDlg.cs index a53abed622..a2298528c5 100644 --- a/Src/xWorks/XmlDocConfigureDlg.cs +++ b/Src/xWorks/XmlDocConfigureDlg.cs @@ -4673,7 +4673,9 @@ private void SetNewActiveConfiguration(string newActiveConfig) private void m_linkConfigureHomograph_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("ConfigureHeadwordNumbers", this); +#pragma warning restore 618 } #region ILayoutConverter methods diff --git a/Src/xWorks/XmlDocView.cs b/Src/xWorks/XmlDocView.cs index fd2ce04d49..50c4325ba1 100644 --- a/Src/xWorks/XmlDocView.cs +++ b/Src/xWorks/XmlDocView.cs @@ -1213,8 +1213,12 @@ private void RunConfigureDialog(string nodePath) m_mainView.ResetTables(sNewLayout); SelectAndScrollToCurrentRecord(); } - if(dlg.MasterRefreshRequired) + if (dlg.MasterRefreshRequired) + { +#pragma warning disable 618 // suppress obsolete warning m_mediator.SendMessage("MasterRefresh", null); +#pragma warning restore 618 + } } }