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
4 changes: 2 additions & 2 deletions Src/Common/Controls/DetailControls/Slice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ public virtual void Expand(int iSlice)
Expansion = DataTree.TreeItemState.ktisExpanded;
if (m_propertyTable != null)
{
m_propertyTable.SetProperty(ExpansionStateKey, true, true);
m_propertyTable.SetProperty(ExpansionStateKey, true, false);
}
}
finally
Expand Down Expand Up @@ -1601,7 +1601,7 @@ public virtual void Collapse(int iSlice)
Expansion = DataTree.TreeItemState.ktisCollapsed;
if (m_propertyTable != null)
{
m_propertyTable.SetProperty(ExpansionStateKey, false, true);
m_propertyTable.SetProperty(ExpansionStateKey, false, false);
}
}
finally
Expand Down
4 changes: 2 additions & 2 deletions Src/Common/Controls/XMLViews/BrowseViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ private void SaveColumnWidths()
{
int nNewWidth = m_lvHeader.ColumnsInDisplayOrder[ColumnHeaderIndex(iCol)].Width;
string PropName = FormatColumnWidthPropertyName(iCol);
m_propertyTable.SetProperty(PropName, nNewWidth, PropertyTable.SettingsGroup.LocalSettings, true);
m_propertyTable.SetProperty(PropName, nNewWidth, PropertyTable.SettingsGroup.LocalSettings, false);
}
}

Expand Down Expand Up @@ -3080,7 +3080,7 @@ protected void UpdateColumnList()
colList.Append("<hidden label=\"" + SecurityElement.Escape(label) + "\"/>");
}
colList.Append("</root>");
m_propertyTable.SetProperty(m_xbv.Vc.ColListId, colList.ToString(), PropertyTable.SettingsGroup.LocalSettings, true);
m_propertyTable.SetProperty(m_xbv.Vc.ColListId, colList.ToString(), PropertyTable.SettingsGroup.LocalSettings, false);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Src/Common/Controls/XMLViews/ReallySimpleListChooser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,7 @@ private void Persist()
{
if (m_webBrowser != null)
{
m_propertyTable.SetProperty("SimpleListChooser-HelpBrowserSplitterDistance", m_splitContainer.SplitterDistance, true);
m_propertyTable.SetProperty("SimpleListChooser-HelpBrowserSplitterDistance", m_splitContainer.SplitterDistance, false);
m_persistProvider.PersistWindowSettings("SimpleListChooser-HelpBrowser", this);
}
else
Expand Down
2 changes: 1 addition & 1 deletion Src/Common/Controls/XMLViews/SearchEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static SearchEngine Get(Mediator mediator, PropertyTable propertyTable, s
if (searchEngine == null)
{
searchEngine = searchEngineFactory();
propertyTable.SetProperty(propName, searchEngine, true);
propertyTable.SetProperty(propName, searchEngine, false);
propertyTable.SetPropertyDispose(propName, true);
propertyTable.SetPropertyPersistence(propName, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using NUnit.Framework;
using SIL.FieldWorks.Common.ViewsInterfaces;
using SIL.LCModel;
using SIL.LCModel.Core.KernelInterfaces;
using XCore;

namespace XMLViewsTests
Expand Down Expand Up @@ -37,10 +36,6 @@ public void InstallXmlVcForTest(SIL.FieldWorks.Common.Controls.XmlVc xmlVc)
m_xmlVc = xmlVc;
}

public void InstallPropertyTableForTest(PropertyTable propertyTable)
{
m_propertyTable = propertyTable;
}
}

[TestFixture]
Expand Down Expand Up @@ -144,42 +139,5 @@ public void XmlSeqViewResetRoot_ReassignsRootObjectAndReconstructs()
}
}

[Test]
public void XmlSeqViewOnPropertyChanged_ShowFailingItemsChange_ReconstructsRootBox()
{
using (var view = new TestXmlSeqView())
using (var propertyTable = new PropertyTable(null))
{
var rootBox = new FakeXmlBrowseViewBase.FakeRootBox();
view.InstallRootBoxForTest(rootBox);
view.InstallXmlVcForTest(new SIL.FieldWorks.Common.Controls.XmlVc("root", false, view, null, (ISilDataAccess)null));
view.InstallPropertyTableForTest(propertyTable);
propertyTable.SetProperty("currentContentControl", "tool", false);
propertyTable.SetProperty("ShowFailingItems-tool", true, false);

view.OnPropertyChanged("ShowFailingItems-tool");

Assert.That(rootBox.ReconstructCallCount, Is.EqualTo(1));
}
}

[Test]
public void XmlSeqViewOnPropertyChanged_ShowFailingItemsUnchanged_DoesNotReconstructRootBox()
{
using (var view = new TestXmlSeqView())
using (var propertyTable = new PropertyTable(null))
{
var rootBox = new FakeXmlBrowseViewBase.FakeRootBox();
view.InstallRootBoxForTest(rootBox);
view.InstallXmlVcForTest(new SIL.FieldWorks.Common.Controls.XmlVc("root", false, view, null, (ISilDataAccess)null));
view.InstallPropertyTableForTest(propertyTable);
propertyTable.SetProperty("currentContentControl", "tool", false);
propertyTable.SetProperty("ShowFailingItems-tool", false, false);

view.OnPropertyChanged("ShowFailingItems-tool");

Assert.That(rootBox.ReconstructCallCount, Is.EqualTo(0));
}
}
}
}
14 changes: 0 additions & 14 deletions Src/Common/Controls/XMLViews/XmlBrowseView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,6 @@ public override XmlBrowseViewBaseVc Vc
}
}

/// <summary>
/// This is invoked by the PropertyTable (because XmlBrowseView is a mediator).
/// </summary>
/// <param name="propName"></param>
public override void OnPropertyChanged(string propName)
{
CheckDisposed();

if (propName == GetCorrespondingPropertyName("readOnlyBrowse"))
SetSelectedRowHighlighting();

base.OnPropertyChanged(propName);
}

private ITsString StripTrailingNewLine(ITsString tss)
{
string val = tss.Text;
Expand Down
4 changes: 2 additions & 2 deletions Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ internal static XmlDocument GetSavedColumns(string savedCols, Mediator mediator,
goto case 19;
case 19:
savedCols = savedCols.Replace("root version=\"19\"", "root version=\"20\"");
propertyTable.SetProperty(colListId, savedCols, true);
propertyTable.SetProperty(colListId, savedCols, false);
doc.LoadXml(savedCols);
break;
default:
Expand All @@ -344,7 +344,7 @@ internal static XmlDocument GetSavedColumns(string savedCols, Mediator mediator,
doc = null;
// Forget the old settings, so we don't keep complaining every time the program runs.
// There doesn't seem to be any way to remove the property altogether, so at least, make it empty.
propertyTable.SetProperty(colListId, "", PropertyTable.SettingsGroup.LocalSettings, true);
propertyTable.SetProperty(colListId, "", PropertyTable.SettingsGroup.LocalSettings, false);
break;
}
}
Expand Down
39 changes: 2 additions & 37 deletions Src/Common/Controls/XMLViews/XmlSeqView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ public class XmlSeqView : RootSite
protected XmlVc m_xmlVc;
/// <summary></summary>
protected IFwMetaDataCache m_mdc;
bool m_fShowFailingItems; // display items that fail the condition specified in the view.
private IApp m_app;

/// <summary>
Expand Down Expand Up @@ -316,7 +315,7 @@ public override void MakeRoot()

bool fEditable = XmlUtils.GetOptionalBooleanAttributeValue(m_xnSpec, "editable", true);
string toolName = m_propertyTable.GetStringProperty("currentContentControl", null);
m_fShowFailingItems = m_propertyTable.GetBoolProperty("ShowFailingItems-" + toolName, false);
bool fShowFailingItems = m_propertyTable.GetBoolProperty("ShowFailingItems-" + toolName, false);
//m_xmlVc = new XmlVc(m_xnSpec, Table); // possibly reinstate for old approach?
// Note: we want to keep this logic similar to RecordDocView.GetLayoutName(), except that here
// we do NOT want to use the layoutSuffix, though it may be specified so that it can be
Expand All @@ -329,7 +328,7 @@ public override void MakeRoot()
sLayout = XmlUtils.GetMandatoryAttributeValue(m_xnSpec, "layout");
ISilDataAccess sda = GetSda();
m_xmlVc = new XmlVc(sLayout, fEditable, this, m_app,
m_fShowFailingItems ? null : ItemDisplayCondition, sda) {IdentifySource = true};
fShowFailingItems ? null : ItemDisplayCondition, sda) {IdentifySource = true};
ReadOnlyView = !fEditable;
if (!fEditable)
m_rootb.MaxParasToScan = 0;
Expand Down Expand Up @@ -358,40 +357,6 @@ private XmlNode ItemDisplayCondition
get { return m_xnSpec.SelectSingleNode("elementDisplayCondition"); }
}

/// <summary>
/// Receives the broadcast message "PropertyChanged"
/// </summary>
public override void OnPropertyChanged(string name)
{
CheckDisposed();

base.OnPropertyChanged(name);
string toolName = m_propertyTable.GetStringProperty("currentContentControl", null);
if(name == "ShowFailingItems-" + toolName)
{
bool fShowFailingItems = m_propertyTable.GetBoolProperty(name, false);
if (fShowFailingItems != m_fShowFailingItems)
{
m_fShowFailingItems = fShowFailingItems;
m_xmlVc.MakeRootCommand(this, m_fShowFailingItems ? null : ItemDisplayCondition);
try
{
EditingHelper.DefaultCursor = Cursors.WaitCursor;
using (new WaitCursor(TopLevelControl))
{
m_rootb.Reconstruct();
Invalidate();
Update(); // most of the time is the painting, we want the watch cursor till it's done.
}
}
finally
{
EditingHelper.DefaultCursor = null;
}
}
}
}

/// -----------------------------------------------------------------------------------
/// <summary>
/// Notifies the site that something about the selection has changed.
Expand Down
4 changes: 2 additions & 2 deletions Src/Common/FieldWorks/FieldWorks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ private static ProjectId ShowWelcomeDialog(FwAppArgs args, FwApp startingApp, Pr
var activeWindowInterface = (IFwMainWnd)activeWindow;
activeWindowInterface.PropTable.SetProperty("LastBridgeUsed",
obtainedProjectType == ObtainedProjectType.Lift ? "LiftBridge" : "FLExBridge",
PropertyTable.SettingsGroup.LocalSettings, true);
PropertyTable.SettingsGroup.LocalSettings, false);
}
}
}
Expand Down Expand Up @@ -1912,7 +1912,7 @@ internal static ProjectId ChooseLangProject(Form dialogOwner, IHelpTopicProvider
activeWindowInterface.PropTable.SetProperty("LastBridgeUsed",
dlg.ObtainedProjectType == ObtainedProjectType.Lift ? "LiftBridge" : "FLExBridge",
PropertyTable.SettingsGroup.LocalSettings,
true);
false);
}

if (dlg.DialogResult == DialogResult.OK)
Expand Down
12 changes: 6 additions & 6 deletions Src/Common/FieldWorks/LexicalProvider/LexicalProviderImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public void ShowEntry(string entry, EntryType entryType)
using (Mediator mediator = new Mediator())
using (PropertyTable propertyTable = new PropertyTable(mediator))
{
propertyTable.SetProperty("HelpTopicProvider", FieldWorks.GetHelpTopicProvider(), true);
propertyTable.SetProperty("HelpTopicProvider", FieldWorks.GetHelpTopicProvider(), false);
propertyTable.SetPropertyPersistence("HelpTopicProvider", false);
var flexApp = FieldWorks.GetOrCreateFlexApp();
propertyTable.SetProperty("FeedbackInfoProvider", flexApp, true);
propertyTable.SetProperty("FeedbackInfoProvider", flexApp, false);
propertyTable.SetPropertyPersistence("FeedbackInfoProvider", false);
propertyTable.SetProperty("App", flexApp, true);
propertyTable.SetProperty("App", flexApp, false);

LexEntryUi.DisplayEntry(FieldWorks.Cache, mediator, propertyTable, propertyTable.GetValue<IHelpTopicProvider>("HelpTopicProvider"),
"UserHelpFile", tss, null);
Expand Down Expand Up @@ -109,12 +109,12 @@ public void ShowRelatedWords(string entry, EntryType entryType)
using (Mediator mediator = new Mediator())
using (PropertyTable propertyTable = new PropertyTable(mediator))
{
propertyTable.SetProperty("HelpTopicProvider", FieldWorks.GetHelpTopicProvider(), true);
propertyTable.SetProperty("HelpTopicProvider", FieldWorks.GetHelpTopicProvider(), false);
propertyTable.SetPropertyPersistence("HelpTopicProvider", false);
var flexApp = FieldWorks.GetOrCreateFlexApp();
propertyTable.SetProperty("FeedbackInfoProvider", flexApp, true);
propertyTable.SetProperty("FeedbackInfoProvider", flexApp, false);
propertyTable.SetPropertyPersistence("FeedbackInfoProvider", false);
propertyTable.SetProperty("App", flexApp, true);
propertyTable.SetProperty("App", flexApp, false);

LexEntryUi.DisplayRelatedEntries(FieldWorks.Cache, mediator, propertyTable, propertyTable.GetValue<IHelpTopicProvider>("HelpTopicProvider"),
"UserHelpFile", tss);
Expand Down
4 changes: 2 additions & 2 deletions Src/FdoUi/Dialogs/MergeObjectDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ private void MergeObjectDlg_Closed(object sender, EventArgs e)
{
if (m_propertyTable != null)
{
m_propertyTable.SetProperty("mergeDlgLocation", Location, true);
m_propertyTable.SetProperty("mergeDlgSize", Size, true);
m_propertyTable.SetProperty("mergeDlgLocation", Location, false);
m_propertyTable.SetProperty("mergeDlgSize", Size, false);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Src/FdoUi/LexEntryUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private static IVwStylesheet GetStyleSheet(LcmCache cache, PropertyTable propert
// (new) mediator.
LcmStyleSheet styleSheet = new LcmStyleSheet();
styleSheet.Init(cache, cache.LanguageProject.Hvo, LangProjectTags.kflidStyles);
propertyTable.SetProperty("LcmStyleSheet", styleSheet, true);
propertyTable.SetProperty("LcmStyleSheet", styleSheet, false);
propertyTable.SetPropertyPersistence("LcmStyleSheet", false);
return styleSheet;
}
Expand All @@ -325,7 +325,7 @@ private static void EnsureWindowConfiguration(PropertyTable propertyTable)
// files (true argument) but just trust that we put enough in the installer to make it work.
XmlDocument configuration = XWindow.LoadConfigurationWithIncludes(configFile, true);
XmlNode windowConfigurationNode = configuration.SelectSingleNode("window");
propertyTable.SetProperty("WindowConfiguration", windowConfigurationNode, true);
propertyTable.SetProperty("WindowConfiguration", windowConfigurationNode, false);
propertyTable.SetPropertyPersistence("WindowConfiguration", false);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Src/FwCoreDlgs/FwFindReplaceDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1452,11 +1452,11 @@ protected override void OnClosing(CancelEventArgs e)
if (m_mediator != null && m_propertyTable != null)
{
string propertyName = kPersistenceLabel + "DlgLocation";
m_propertyTable.SetProperty(propertyName, Location, true);
m_propertyTable.SetProperty(propertyName, Location, false);
propertyName = kPersistenceLabel + "ShowMore";
m_propertyTable.SetProperty(propertyName,
Height == m_heightDlgMore ? "true" : "false",
true);
false);
}
base.OnClosing(e);
// If no other handler of this event tried to intervene, the dialog itself will
Expand Down
4 changes: 2 additions & 2 deletions Src/LexText/Discourse/ConstituentChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ internal void PersistAndDisplayChangedLineChoices()
PropertyTable.SetProperty(ConfigPropName,
m_ribbon.Vc.LineChoices.Persist(Cache.LanguageWritingSystemFactoryAccessor),
PropertyTable.SettingsGroup.LocalSettings,
true);
false);
UpdateDisplayForNewLineChoices();
}

Expand Down Expand Up @@ -1211,7 +1211,7 @@ void PersistColumnWidths()
}
colList.Append("</root>");
var cwId = ColWidthId();
PropertyTable.SetProperty(cwId, colList.ToString(), true);
PropertyTable.SetProperty(cwId, colList.ToString(), false);
}

private string ColWidthId()
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/FlexPathwayPlugin/FlexPathwayPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ protected void ExportTool(string areaChoice, string toolChoice, string exportFor
File.Delete(filePath);
if (!ChangeAreaTool(areaChoice, toolChoice))
return;
exportDialog.PropTable.SetProperty("ExportDir", Path.GetDirectoryName(filePath), true);
exportDialog.PropTable.SetProperty("ExportDir", Path.GetDirectoryName(filePath), false);
exportDialog.PropTable.SetPropertyPersistence("ExportDir", true);
using (DeExportDialog ed = new DeExportDialog(exportDialog.Mediator, exportDialog.PropTable))
{
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/Interlinear/ComplexConcControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public override void Init(Mediator mediator, PropertyTable propertyTable, XmlNod
if (pattern == null)
{
pattern = new ComplexConcGroupNode();
m_propertyTable.SetProperty("ComplexConcPattern", pattern, true);
m_propertyTable.SetProperty("ComplexConcPattern", pattern, false);
m_propertyTable.SetPropertyPersistence("ComplexConcPattern", false);
}
m_patternModel = new ComplexConcPatternModel(m_cache, pattern);
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/Interlinear/FilterTextsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected void OnOk(object obj, EventArgs e)
if (own != null && OnlyGenresChecked(checkedList))
{
message = ITextStrings.kOkbtnGenreSelection;
own.PropTable.SetProperty("RecordClerk-DelayedGenreAssignment", checkedList, true);
own.PropTable.SetProperty("RecordClerk-DelayedGenreAssignment", checkedList, false);
showWarning = true;
}
if (m_treeTexts.GetNodesWithState(TriStateTreeView.CheckState.Checked).Length == 0)
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/Interlinear/InfoPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private void InitializeInfoView(RecordClerk clerk)
var activeClerkNew = m_propertyTable.GetValue<RecordClerk>("ActiveClerk");
if (toolChoice != "interlinearEdit" && activeClerk != null && activeClerk != activeClerkNew)
{
m_propertyTable.SetProperty("ActiveClerk", activeClerk, true);
m_propertyTable.SetProperty("ActiveClerk", activeClerk, false);
activeClerk.ActivateUI(true);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/Interlinear/InterlinDocForAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ internal AnalysisOccurrence SelectedOccurrence
((InterlinDocForAnalysisVc)Vc).FocusBoxOccurrence = value;
m_propertyTable.SetProperty("TextSelectedWord",
value != null && value.HasWordform ? value.Analysis.Wordform : null,
true);
false);
m_propertyTable.SetPropertyPersistence("TextSelectedWord", false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/Interlinear/InterlinDocRootSiteBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ internal void PersistAndDisplayChangedLineChoices()
m_propertyTable.SetProperty(ConfigPropName,
Vc.LineChoices.Persist(m_cache.LanguageWritingSystemFactoryAccessor),
PropertyTable.SettingsGroup.LocalSettings,
true);
false);
UpdateDisplayForNewLineChoices();
}

Expand Down
2 changes: 1 addition & 1 deletion Src/LexText/Interlinear/RawTextPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ protected override void HandleSelectionChange(IVwRootBox rootb, IVwSelection vws
IWfiWordform wordform;
if (!GetSelectedWordform(vwselNew, out wordform))
wordform = null;
m_propertyTable.SetProperty("TextSelectedWord", wordform, true);
m_propertyTable.SetProperty("TextSelectedWord", wordform, false);
m_propertyTable.SetPropertyPersistence("TextSelectedWord", false);

SelectionHelper helper = SelectionHelper.Create(vwselNew, this);
Expand Down
Loading
Loading