SIL.FieldWorks.Common.Controls.OwnMlPropReadWriter.SetStringValue C# (CSharp) Method

SetStringValue() protected method

protected SetStringValue ( int hvoStringOwner, ITsString tss ) : void
hvoStringOwner int
tss ITsString
return void
		protected override void SetStringValue(int hvoStringOwner, ITsString tss)
		{
			if (!m_fFieldAllowsMultipleRuns && tss.RunCount > 1)
			{
				// Illegally trying to store a multi-run TSS in a single-run field. This will fail.
				// Typically it's just that we tried to insert an English comma or similar.
				// Patch it up by making the whole string take on the properties of the first run.
				var bldr = tss.GetBldr();
				bldr.SetProperties(0, bldr.Length, tss.get_Properties(0));
				tss = bldr.GetString();
			}
			m_sda.SetMultiStringAlt(hvoStringOwner, m_flid, m_ws, tss);
		}
	}