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
25 changes: 0 additions & 25 deletions Src/Common/Framework/FwApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,6 @@ public abstract class FwApp : IApp, ISettings, IDisposable, IHelpTopicProvider,
protected DebugProcs m_debugProcs;
#endif
private FwRegistrySettings m_registrySettings;
/// <summary>
/// null means that we are not suppressing view refreshes.
/// True means we're suppressing and we need to do a refresh when finished.
/// False means we're suppressing, but have no need to do a refresh when finished.
/// </summary>
private bool? m_refreshView;

/// <summary>The find patterns for the find/replace dialog, one for each database.</summary>
/// <remarks>We need one pattern per database (cache). Otherwise it'll crash when we try to
Expand Down Expand Up @@ -542,7 +536,6 @@ protected virtual void Dispose(bool disposing)
m_registrySettings = null;
m_findPattern = null;
m_findReplaceDlg = null;
m_refreshView = null;
PictureHolder = null;
#if DEBUG
m_debugProcs = null;
Expand Down Expand Up @@ -1044,24 +1037,6 @@ public List<IFwMainWnd> MainWindows
}
}

/// ------------------------------------------------------------------------------------
/// <summary>
/// Refreshes all the views in all of the Main Windows of the app.
/// </summary>
/// ------------------------------------------------------------------------------------
public void RefreshAllViews()
{
CheckDisposed();

if (m_refreshView != null)
m_refreshView = true;
else
{
foreach (IFwMainWnd wnd in MainWindows)
wnd.RefreshAllViews();
}
}

/// <summary>
/// Restart the spell-checking process (e.g. when dictionary changed)
/// </summary>
Expand Down
7 changes: 0 additions & 7 deletions Src/Common/Framework/IFwMainWnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ public interface IFwMainWnd : IxWindow
/// ------------------------------------------------------------------------------------
bool OnEditFind(object args);

/// ------------------------------------------------------------------------------------
/// <summary>
/// Refreshes all the views that belong to this main window
/// </summary>
/// ------------------------------------------------------------------------------------
void RefreshAllViews();

/// ------------------------------------------------------------------------------------
/// <summary>
/// Closes this instance.
Expand Down
7 changes: 0 additions & 7 deletions Src/Common/RootSite/IApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ public interface IApp
/// </summary>
PictureHolder PictureHolder { get; }

/// ------------------------------------------------------------------------------------
/// <summary>
/// Refreshes all the views in all of the Main Windows of the app.
/// </summary>
/// ------------------------------------------------------------------------------------
void RefreshAllViews();

/// <summary>
/// Restart the spell-checking process (e.g. when dictionary changed)
/// </summary>
Expand Down
3 changes: 0 additions & 3 deletions Src/Common/RootSite/UndoActions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Copyright (c) 2003-2013 SIL International
// This software is licensed under the LGPL, version 2.1 or later
// (http://www.gnu.org/licenses/lgpl-2.1.html)
//
// File: UndoActions.cs
// Responsibility: TE Team

using System.Diagnostics;
using System.Windows.Forms;
Expand Down
5 changes: 0 additions & 5 deletions Src/LexText/Interlinear/ConcordanceControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1781,11 +1781,6 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}

protected override void RefreshAfterInvalidObject()
{
ConcordanceControl.LoadMatches(true);
}

/// <summary>
/// Overridden to prevent trying to get a name for the "current object" which we can't do because
/// it is not a true CmObject.
Expand Down
4 changes: 2 additions & 2 deletions Src/LexText/Interlinear/InterlinearTextsRecordClerk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public override void ReloadIfNeeded()

public override bool OnRefresh(object sender)
{
if(m_list as ConcordanceWordList != null)
if(m_list is ConcordanceWordList cwList)
{
((ConcordanceWordList)m_list).RequestRefresh();
cwList.RequestRefresh();
}
return base.OnRefresh(sender);
}
Expand Down
1 change: 0 additions & 1 deletion Src/LexText/LexTextDll/LexTextApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.IO;
using System.Windows.Forms;
using System.Diagnostics;
using System.ComponentModel;
using System.Runtime.InteropServices;
using SIL.FieldWorks.Common.Controls;
using SIL.FieldWorks.Common.Framework;
Expand Down
6 changes: 2 additions & 4 deletions Src/LexText/Morphology/PhEnvStrRepresentationSlice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ private void DoValidation(bool refresh)
{
if (frm != null)
wc = new WaitCursor(frm);
ConstraintFailure failure;
m_env.CheckConstraints(PhEnvironmentTags.kflidStringRepresentation, true, out failure, /* adjust the squiggly line */ true);
m_env.CheckConstraints(PhEnvironmentTags.kflidStringRepresentation, true, out _, /* adjust the squiggly line */ true);
// This will make the record list update to the new value.
if (refresh)
{
Expand All @@ -322,8 +321,7 @@ private void DoValidation(bool refresh)
}
finally
{
if (wc != null)
wc.Dispose();
wc?.Dispose();
}
}

Expand Down
41 changes: 0 additions & 41 deletions Src/xWorks/FwXWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,29 +1605,6 @@ protected bool OnUndo(object args)
return false;
}

private void HandleUndoResult(UndoResult ures, bool fPrivate)
{
// Enhance JohnT: may want to display messages for kuresFailed, kuresError
if (ures != UndoResult.kuresSuccess)
{

if (!fPrivate && m_app != null)
{
// currently implemented, this will cause this app to do a master refresh,
m_app.Synchronize();
}
else
{
// 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
}
}
}

/// ------------------------------------------------------------------------------------
/// <summary>
/// Disables/enables the Edit/Undo menu item
Expand Down Expand Up @@ -2397,24 +2374,6 @@ private void ResyncRootboxStyles()
}
}

/// ------------------------------------------------------------------------------------
/// <summary>
/// JohnT: this might be a poorly named or obsolete message. Kept because there are
/// some callers and I don't have time to analyze them all. Generally better to use
/// RefreshDisplay().
/// </summary>
/// ------------------------------------------------------------------------------------
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);
}

/// ------------------------------------------------------------------------------------
/// <summary>
/// Gets the currently active view (client window).
Expand Down
17 changes: 2 additions & 15 deletions Src/xWorks/RecordClerk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
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;
using SIL.LCModel.DomainServices;
Expand Down Expand Up @@ -1156,8 +1155,7 @@ public virtual bool OnRefresh(object argument)
var window = m_propertyTable.GetValue<Form>("window");
using (new WaitCursor(window))
{
if (m_rch != null)
m_rch.Fixup(false); // no need to recursively refresh!
m_rch?.Fixup(false); // no need to recursively refresh!
m_list.ReloadList();
return false; //that other colleagues do a refresh, too.
}
Expand Down Expand Up @@ -2058,8 +2056,7 @@ virtual public bool IsControllingTheRecordTreeBar
m_propertyTable.SetProperty("UpdateStatusBar", m_updateStatusBar, true);
m_propertyTable.SetPropertyPersistence("UpdateStatusBar", false);

if (oldActiveClerk != null)
oldActiveClerk.BecomeInactive();
oldActiveClerk?.BecomeInactive();
m_propertyTable.SetProperty("OldActiveClerk", oldActiveClerk, true);
m_propertyTable.SetPropertyPersistence("OldActiveClerk", false);
m_propertyTable.SetProperty("ActiveClerk", this, true);
Expand Down Expand Up @@ -2333,16 +2330,6 @@ protected virtual void ClearInvalidSubitem()
{
}

/// <summary>
/// Handles refreshing the record list after an object was deleted.
/// </summary>
/// <remarks>This should be overriden to perform more efficient refreshing of the record list display</remarks>
protected virtual void RefreshAfterInvalidObject()
{
// to be safe we just do a full refresh
m_propertyTable.GetValue<IApp>("App").RefreshAllViews();
}

private int FindClosestValidIndex(int idx, int cobj)
{
for (int i = idx + 1; i < cobj; ++i)
Expand Down
Loading