protected override void SetInfoBarText() { if (m_informationBar == null) { return; } string titleStr = ""; // See if we have an AlternativeTitle string table id for an alternate title. string titleId = XmlUtils.GetAttributeValue(m_configurationParameters, "altTitleId"); if (titleId != null) { XmlViewsUtils.TryFindString("AlternativeTitles", titleId, out titleStr); // if they specified an altTitleId, but it wasn't found, they need to do something, // so just return *titleId* if (Clerk.OwningObject != null && titleId.StartsWith("Reversal") && XmlUtils.GetBooleanAttributeValue(m_configurationParameters, "ShowOwnerShortname")) { // Originally this option was added to enable Bulk Edit Reversal Entries title bar to show // which reversal index was being shown. If the 'titleId.StartsWith("Reversal")' in the 'if' // above is removed then the Word List Concordance shows the word being concorded in the // right pane title bar. titleStr = string.Format(xWorksStrings.ksXReversalIndex, Clerk.OwningObject.ShortName, titleStr); } } else if (Clerk.OwningObject != null) { if (XmlUtils.GetBooleanAttributeValue(m_configurationParameters, "ShowOwnerShortname")) { titleStr = Clerk.OwningObject.ShortName; } } if (String.IsNullOrEmpty(titleStr)) { XmlViewsUtils.TryFindPluralFormFromFlid(Clerk.VirtualListPublisher.MetaDataCache, Clerk.OwningFlid, out titleStr); } bool fBaseCalled = false; if (String.IsNullOrEmpty(titleStr)) { base.SetInfoBarText(); fBaseCalled = true; // titleStr = ((IPaneBar)m_informationBar).Text; // can't get to work. // (EricP) For some reason I can't provide an IPaneBar get-accessor to return // the new Text value. If it's desirable to allow TitleFormat to apply to // Clerk.CurrentObject, then we either have to duplicate what the // base.SetInfoBarText() does here, or get the string set by the base. // for now, let's just return. if (string.IsNullOrEmpty(titleStr)) { return; } } // If we have a format attribute, format the title accordingly. string sFmt = XmlUtils.GetAttributeValue(m_configurationParameters, "TitleFormat"); if (sFmt != null) { titleStr = String.Format(sFmt, titleStr); } // if we haven't already set the text through the base, // or if we had some formatting to do, then set the infoBar text. if (!fBaseCalled || sFmt != null) { ((IPaneBar)m_informationBar).Text = titleStr; } }
protected override void SetInfoBarText() { if (m_informationBar == null) { return; } string titleStr = ""; // See if we have an AlternativeTitle string table id for an alternate title. string titleId = XmlUtils.GetAttributeValue(m_configurationParameters, "altTitleId"); if (titleId != null) { XmlViewsUtils.TryFindString(StringTbl, "AlternativeTitles", titleId, out titleStr); // if they specified an altTitleId, but it wasn't found, they need to do something, // so just return *titleId* } else if (Clerk.OwningObject != null) { if (XmlUtils.GetBooleanAttributeValue(m_configurationParameters, "ShowOwnerShortname")) { titleStr = Clerk.OwningObject.ShortName; } } if (String.IsNullOrEmpty(titleStr)) { XmlViewsUtils.TryFindPluralFormFromFlid(Cache, StringTbl, (uint)Clerk.OwningFlid, out titleStr); } bool fBaseCalled = false; if (titleStr == string.Empty) { base.SetInfoBarText(); fBaseCalled = true; // titleStr = ((IPaneBar)m_informationBar).Text; // can't get to work. // (EricP) For some reason I can't provide an IPaneBar get-accessor to return // the new Text value. If it's desirable to allow TitleFormat to apply to // Clerk.CurrentObject, then we either have to duplicate what the // base.SetInfoBarText() does here, or get the string set by the base. // for now, let's just return. if (titleStr == null || titleStr == string.Empty) { return; } } // If we have a format attribute, format the title accordingly. string sFmt = XmlUtils.GetAttributeValue(m_configurationParameters, "TitleFormat"); if (sFmt != null) { titleStr = String.Format(sFmt, titleStr); } // if we haven't already set the text through the base, // or if we had some formatting to do, then set the infoBar text. if (!fBaseCalled || sFmt != null) { ((IPaneBar)m_informationBar).Text = titleStr; } }