public virtual void Init(Mediator mediator, XmlNode configurationParameters) { CheckDisposed(); m_mediator = mediator; m_helpTopicProvider = m_mediator.HelpTopicProvider; m_configurationParameters = configurationParameters; m_cache = (FdoCache)mediator.PropertyTable.GetValue("cache"); string name = RecordClerk.GetCorrespondingPropertyName(XmlUtils.GetAttributeValue(configurationParameters, "clerk")); m_clerk = (OccurrencesOfSelectedUnit) m_mediator.PropertyTable.GetValue(name) ?? (OccurrencesOfSelectedUnit) RecordClerkFactory.CreateClerk(m_mediator, m_configurationParameters, true); m_clerk.ConcordanceControl = this; }
public void Init(Mediator mediator, XmlNode configurationParameters) { CheckDisposed(); m_mediator = mediator; m_configurationParameters = configurationParameters; m_cache = (FdoCache)mediator.PropertyTable.GetValue("cache"); string name = XmlUtils.GetAttributeValue(configurationParameters, "clerk"); m_clerk = (OccurrencesOfSelectedUnit)m_mediator.PropertyTable.GetValue(name); if (m_clerk == null) m_clerk = RecordClerkFactory.CreateClerk(m_mediator, m_configurationParameters) as OccurrencesOfSelectedUnit; m_clerk.ConcordanceControl = this; m_tbSearchText.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor; m_tbSearchText.StyleSheet = SIL.FieldWorks.Common.Widgets.FontHeightAdjuster.StyleSheetFromMediator(mediator); m_tbSearchText.Text = String.Empty; m_tbSearchText.TextChanged += new EventHandler(m_tbSearchText_TextChanged); m_tbSearchText.KeyDown += new KeyEventHandler(m_tbSearchText_KeyDown); FillLineComboList(); m_fwtbItem.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor; m_fwtbItem.StyleSheet = SIL.FieldWorks.Common.Widgets.FontHeightAdjuster.StyleSheetFromMediator(m_mediator); m_fwtbItem.WritingSystemCode = m_cache.DefaultVernWs; m_fwtbItem.Text = String.Empty; // Set some default values. m_rbtnAnywhere.Checked = true; m_btnRegExp.Enabled = false; m_chkMatchDiacritics.Checked = false; m_chkMatchCase.Checked = false; m_btnSearch.Enabled = false; if (m_clerk.SuspendLoadingRecordUntilOnJumpToRecord) { return; // we're bound to process OnJumpToRecord, so skip any further initialization. } // Load any saved settings. LoadSettings(); // if we need to reload the property, we'll just clear our results, so that we won't automatically load the list. (LT-6967) if (m_clerk.NeedToReloadVirtualProperty) { m_clerk.NeedToReloadVirtualProperty = false; ClearResults(); } }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { if (components != null) components.Dispose(); if (m_clerk != null) m_clerk.ConcordanceControl = null; // Don't dispose of the clerk, since it can monitor relevant PropChanges // that affect the NeedToReloadVirtualProperty. } m_clerk = null; m_mediator = null; base.Dispose(disposing); }