Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Src/Common/Controls/DetailControls/DataTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using SIL.FieldWorks.Common.Controls;
using SIL.FieldWorks.Common.Framework.DetailControls.Resources;
using SIL.FieldWorks.Common.FwUtils;
using static SIL.FieldWorks.Common.FwUtils.FwUtils;
using SIL.FieldWorks.Common.RootSites;
using SIL.LCModel;
using SIL.LCModel.Core.Cellar;
Expand Down Expand Up @@ -529,13 +530,12 @@ public LcmStyleSheet StyleSheet

}

public virtual bool OnPostponePropChanged(object commandObject)
private void PostponePropChanged(object commandObject)
{
if ((bool)commandObject == true)
m_postponePropChanged = true;
else
m_postponePropChanged = false;
return true;
}

public void PropChanged(int hvo, int tag, int ivMin, int cvIns, int cvDel)
Expand Down Expand Up @@ -1253,6 +1253,8 @@ protected override void Dispose(bool disposing)

if (disposing)
{
Subscriber.Unsubscribe(EventConstants.PostponePropChanged, PostponePropChanged);

// Do this first, before setting m_fDisposing to true.
if (m_sda != null)
m_sda.RemoveNotification(this);
Expand Down Expand Up @@ -3713,6 +3715,8 @@ public void Init(Mediator mediator, PropertyTable propertyTable, XmlNode configu
// it will override the persisted value.
if (PersistenceProvder != null)
RestorePreferences();

Subscriber.Subscribe(EventConstants.PostponePropChanged, PostponePropChanged);
}

public IxCoreColleague[] GetMessageTargets()
Expand Down
7 changes: 3 additions & 4 deletions Src/Common/Controls/DetailControls/GhostStringSlice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using SIL.FieldWorks.Common.Framework.DetailControls.Resources;
using SIL.LCModel.Core.KernelInterfaces;
using SIL.FieldWorks.Common.FwUtils;
using static SIL.FieldWorks.Common.FwUtils.FwUtils;
using SIL.FieldWorks.Common.RootSites;
using SIL.LCModel;
using SIL.LCModel.Application;
Expand Down Expand Up @@ -455,17 +456,15 @@ private void SwitchToReal()
// will typically dispose this and create a new string slice whose key is our own key
// followed by the flid of the string property.
// To avoid problems, PropChanged must not be postponed (cf. LT-22018).
// Copy m_mediator in case 'this' gets disposed.
Mediator mediator = m_mediator;
int hvoNewObj;
try
{
mediator.SendMessage("PostponePropChanged", false);
Publisher.Publish(new PublisherParameterObject(EventConstants.PostponePropChanged, false));
hvoNewObj = MakeRealObject(tssTyped);
}
finally
{
mediator.SendMessage("PostponePropChanged", true);
Publisher.Publish(new PublisherParameterObject(EventConstants.PostponePropChanged, true));
}

// Now try to make a suitable selection in the slice that replaces this.
Expand Down
2 changes: 2 additions & 0 deletions Src/Common/FwUtils/EventConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ public static class EventConstants
public const string GetContentControlParameters = "GetContentControlParameters";
public const string GetToolForList = "GetToolForList";
public const string HandleLocalHotlink = "HandleLocalHotlink";
public const string JumpToPopupLexEntry = "JumpToPopupLexEntry";
public const string JumpToRecord = "JumpToRecord";
public const string LinkFollowed = "LinkFollowed";
public const string MasterRefresh = "MasterRefresh";
public const string PostponePropChanged = "PostponePropChanged";
public const string PrepareToRefresh = "PrepareToRefresh";
public const string RecordNavigation = "RecordNavigation";
public const string RefreshCurrentList = "RefreshCurrentList";
Expand Down
5 changes: 3 additions & 2 deletions Src/FdoUi/FdoUiCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using SIL.FieldWorks.Common.Framework;
using SIL.LCModel.Core.KernelInterfaces;
using SIL.FieldWorks.Common.FwUtils;
using static SIL.FieldWorks.Common.FwUtils.FwUtils;
using SIL.FieldWorks.Common.RootSites;
using SIL.LCModel;
using SIL.LCModel.DomainServices;
Expand Down Expand Up @@ -399,7 +400,7 @@ public static CmObjectUi CreateNewUiObject(Mediator mediator, PropertyTable prop
try
{
// Don't postpone PropChanged (cf. LT-22095).
mediator?.SendMessage("PostponePropChanged", false);
Publisher.Publish(new PublisherParameterObject(EventConstants.PostponePropChanged, false));
var cache = propertyTable.GetValue<LcmCache>("cache");
switch (classId)
{
Expand All @@ -419,7 +420,7 @@ public static CmObjectUi CreateNewUiObject(Mediator mediator, PropertyTable prop
}
finally
{
mediator?.SendMessage("PostponePropChanged", true);
Publisher.Publish(new PublisherParameterObject(EventConstants.PostponePropChanged, true));
}
}

Expand Down
Loading