SIL.FieldWorks.IText.InfoPane.DisplayCurrentRoot C# (CSharp) Method

DisplayCurrentRoot() private method

private DisplayCurrentRoot ( ) : void
return void
		private void DisplayCurrentRoot()
		{
			if (m_currentRoot > 0)
			{
				m_xrev.DatTree.Visible = true;
				ICmObjectRepository repo = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>();
				ICmObject root;
				// JohnT: I don't know why this is done at all. Therefore I made a minimal change rather than removing it
				// altogether. If someone knows why it sometimes needs doing, please comment. Or if you know why it once did
				// and it no longer applies, please remove it. I added the test that the Clerk is not aleady looking
				// at this object to suppress switching back to the raw text pane when clicking on the Info pane of an empty text.
				// (FWR-3180)
				if (repo.TryGetObject(m_currentRoot, out root) && root is IStText && m_xrev.Clerk.CurrentObjectHvo != m_currentRoot)
					m_xrev.Clerk.JumpToRecord(m_currentRoot);
			}
			else if (m_currentRoot == 0)
			{
				m_xrev.DatTree.Visible = false;
			}
		}