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
2 changes: 1 addition & 1 deletion Src/Common/Controls/XMLViews/BrowseViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4050,7 +4050,7 @@ protected virtual void Dispose(bool disposing)
if (m_bv != null && m_bv.BrowseView != null && m_bv.BrowseView.RootBox != null)
m_bv.BrowseView.RootBox.Reconstruct(); // Otherwise every cell redraws individually!

m_bv.BrowseView.OnRestoreScrollPosition(null);
m_bv.BrowseView.RestoreScrollPosition(null);

if (m_fHiliteWasVisible && m_irow >= 0 && m_irow < m_bv.AllItems.Count)
{
Expand Down
7 changes: 4 additions & 3 deletions Src/Common/Controls/XMLViews/XmlBrowseViewBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ protected override void Dispose( bool disposing )
if (disposing)
{
Subscriber.Unsubscribe(EventConstants.SaveScrollPosition, SaveScrollPosition);
Subscriber.Unsubscribe(EventConstants.RestoreScrollPosition, RestoreScrollPosition);

if (m_bv != null && !m_bv.IsDisposed && m_bv.SpecialCache != null)
m_bv.SpecialCache.RemoveNotification(this);
Expand Down Expand Up @@ -1489,19 +1490,18 @@ internal void SaveScrollPosition(object args)
}

/// <summary>
/// Called through mediator by reflection. (Maybe?)
/// This routine attempts to restore the scroll position previously saved by SaveScrollPosition.
/// Specifically, it attempts to scroll to a position such that the top of the object at index
/// m_iTopOfScreenObjectForScrollPosition is m_dyTopOfScreenOffset pixels below the top of the
/// client area (or above, if m_dyTopOfScreenOffset is negative).
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public bool OnRestoreScrollPosition(object args)
internal void RestoreScrollPosition(object args)
{
CheckDisposed();

return RestoreScrollPosition(m_iTopOfScreenObjectForScrollPosition);
RestoreScrollPosition(m_iTopOfScreenObjectForScrollPosition);
}

/// <summary>
Expand Down Expand Up @@ -2106,6 +2106,7 @@ public override void Init(Mediator mediator, PropertyTable propertyTable, XmlNod
SetSelectedRowHighlighting();//read the property table

Subscriber.Subscribe(EventConstants.SaveScrollPosition, SaveScrollPosition);
Subscriber.Subscribe(EventConstants.RestoreScrollPosition, RestoreScrollPosition);
}

#endregion XCore Colleague overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected override void Dispose(bool fDisposing)
if (fDisposing)
{
if (m_rootSite != null)
((XmlBrowseViewBase)m_rootSite).OnRestoreScrollPosition(null);
((XmlBrowseViewBase)m_rootSite).RestoreScrollPosition(null);
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions Src/xWorks/RecordClerk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3131,11 +3131,8 @@ private void m_list_AboutToReload(object sender, EventArgs e)

private void m_list_DoneReload(object sender, EventArgs e)
{
// This used to be a BroadcastMessage, but now broadcast is deferred.
// To keep the same logic it's now using the SendMessageToAllNow. This
// is different from SendMessage as it is sent to all even if handled.
if (!m_fReloadingDueToMissingObject)
m_mediator.SendMessageToAllNow("RestoreScrollPosition", this);
Publisher.Publish(new PublisherParameterObject(EventConstants.RestoreScrollPosition, this));
}

internal ListUpdateHelper UpdateHelper { get; set; }
Expand Down
Loading