public virtual void OnMasterRefresh(object sender)
{
CheckDisposed();
// Susanna asked that refresh affect only the currently active project, which is
// what the string and List variables below attempt to handle. See LT-6444.
FwXWindow activeWnd = ActiveForm as FwXWindow;
FdoCache activeCache = null;
if (activeWnd != null)
activeCache = activeWnd.Cache;
List<FwXWindow> rgxw = new List<FwXWindow>();
foreach (IFwMainWnd wnd in m_app.MainWindows)
{
FwXWindow xwnd = wnd as FwXWindow;
if (xwnd != null)
{
if (activeCache == null || xwnd.Cache == activeCache)
{
xwnd.PrepareToRefresh();
rgxw.Add(xwnd);
}
}
}
if (activeWnd != null)
rgxw.Remove(activeWnd);
foreach (FwXWindow xwnd in rgxw)
{
xwnd.FinishRefresh();
xwnd.Refresh();
}
// LT-3963: active window changes as a result of a refresh.
// Make sure focus doesn't switch to another FLEx application / window also
// make sure the application focus isn't lost all together.
// ALSO, after doing a refresh with just a single application / window,
// the application would loose focus and you'd have to click into it to
// get that back, this will reset that too.
if (activeWnd != null)
{
// Refresh it last, so its saved settings get restored.
activeWnd.FinishRefresh();
activeWnd.Refresh();
activeWnd.Activate();
}
}