private void InitializeInfoView(RecordClerk clerk) { if (m_mediator == null) { return; } XmlNode xnWindow = (XmlNode)m_mediator.PropertyTable.GetValue("WindowConfiguration"); if (xnWindow == null) { return; } XmlNode xnControl = xnWindow.SelectSingleNode( "controls/parameters/guicontrol[@id=\"TextInformationPane\"]/control/parameters"); if (xnControl == null) { return; } m_xrev = new InterlinearTextsRecordEditView(); m_xrev.Clerk = clerk; m_xrev.Init(m_mediator, xnControl); m_xrev.Dock = DockStyle.Fill; this.Controls.Add(m_xrev); }
private void InitializeInfoView(RecordClerk clerk) { if (m_mediator == null) { return; } if (m_propertyTable == null) { return; } var xnWindow = m_propertyTable.GetValue <XmlNode>("WindowConfiguration"); if (xnWindow == null) { return; } XmlNode xnControl = xnWindow.SelectSingleNode( "controls/parameters/guicontrol[@id=\"TextInformationPane\"]/control/parameters"); if (xnControl == null) { return; } var activeClerk = m_propertyTable.GetValue <RecordClerk>("ActiveClerk"); var toolChoice = m_propertyTable.GetStringProperty("currentContentControl", null); if (m_xrev != null) { //when re-using the infoview we want to remove and dispose of the old recordeditview and //associated datatree. (LT-13216) Controls.Remove(m_xrev); m_xrev.Dispose(); } m_xrev = new InterlinearTextsRecordEditView(this); if (clerk.GetType().Name == "InterlinearTextsRecordClerk") { m_xrev.Clerk = clerk; } else { //We want to make sure that the following initialization line will initialize this //clerk if we haven't already set it. Without this assignment to null, the InfoPane //misbehaves in the Concordance view (it uses the filter from the InterlinearTexts view) m_xrev.Clerk = null; } m_xrev.Init(m_mediator, m_propertyTable, xnControl); // <-- This call will change the ActiveClerk DisplayCurrentRoot(); m_xrev.Dock = DockStyle.Fill; Controls.Add(m_xrev); // There are times when moving to the InfoPane causes the wrong ActiveClerk to be set. // See FWR-3390 (and InterlinearTextsRecordClerk.OnDisplayInsertInterlinText). var activeClerkNew = m_propertyTable.GetValue <RecordClerk>("ActiveClerk"); if (toolChoice != "interlinearEdit" && activeClerk != null && activeClerk != activeClerkNew) { m_propertyTable.SetProperty("ActiveClerk", activeClerk, true); activeClerk.ActivateUI(true); } }