SIL.FieldWorks.Common.Controls.ReplaceWithMethod.OkToChange C# (CSharp) Method

OkToChange() protected method

We can do a replace if the pattern matches.
protected OkToChange ( int hvo ) : bool
hvo int
return bool
		protected override bool OkToChange(int hvo)
		{
			if (!base.OkToChange(hvo))
				return false;
			ITsString tss = OldValue(hvo);
			if (tss == null)
			{
				ITsStrFactory tsf = TsStrFactoryClass.Create();
				tss = tsf.MakeString("", m_accessor.WritingSystem);
			}
			m_textSourceInit.SetString(tss);
			int ichMin, ichLim;
			m_pattern.FindIn(m_ts, 0, tss.Length, true, out ichMin, out ichLim, null);
			return ichMin >= 0;
		}