SIL.FieldWorks.XWorks.DictionaryPublicationDecorator.OwnerOutlineNameForWs C# (CSharp) Method

OwnerOutlineNameForWs() public method

Returns a TsString with the entry headword and a sense number if there are more than one senses.
public OwnerOutlineNameForWs ( ILexSense sense, int wsVern, HomographConfiguration hv ) : ITsString
sense ILexSense
wsVern int
hv SIL.FieldWorks.FDO.DomainImpl.HomographConfiguration
return ITsString
		public ITsString OwnerOutlineNameForWs(ILexSense sense, int wsVern, HomographConfiguration.HeadwordVariant hv)
		{
			var entry = sense.Entry;
			int hn;
			if (!m_homographNumbers.TryGetValue(entry.Hvo, out hn))
				hn = entry.HomographNumber; // unknown entry, use its own HN instead of our override
			ITsIncStrBldr tisb = TsIncStrBldrClass.Create();
			tisb.AppendTsString(StringServices.HeadWordForWsAndHn(entry, wsVern, hn, "", hv));
			var hc = sense.Services.GetInstance<HomographConfiguration>();
			if (hc.ShowSenseNumber(hv) && HasMoreThanOneSense(entry))
			{
				// These int props may not be needed, but they're safe.
				tisb.SetIntPropValues((int)FwTextPropType.ktptWs, 0,
									  Cache.DefaultAnalWs);
				tisb.SetStrPropValue((int)FwTextPropType.ktptNamedStyle,
									  HomographConfiguration.ksSenseReferenceNumberStyle);
				tisb.Append(" ");
				tisb.Append(GetSenseNumber(sense));
			}
			return tisb.GetString();
		}