SIL.FieldWorks.FdoUi.InflectionClassEditor.FakeDoit C# (CSharp) Method

FakeDoit() public method

Fake doing the change by setting the specified property to the appropriate value for each item in the list. Disable items that can't be set.
public FakeDoit ( IEnumerable itemsToChange, int tagFakeFlid, int tagEnable, SIL.FieldWorks.Common.Controls.ProgressState state ) : void
itemsToChange IEnumerable
tagFakeFlid int
tagEnable int
state SIL.FieldWorks.Common.Controls.ProgressState
return void
		public void FakeDoit(IEnumerable<int> itemsToChange, int tagFakeFlid, int tagEnable, ProgressState state)
		{
			CheckDisposed();

			ITsString tss = TsStringUtils.MakeTss(m_selectedLabel, m_cache.DefaultAnalWs);
			// Build a Set of parts of speech that can take this class.
			Set<int> possiblePOS = GetPossiblePartsOfSpeech();

			int i = 0;
			// Report progress 50 times or every 100 items, whichever is more (but no more than once per item!)
			int interval = Math.Min(100, Math.Max(itemsToChange.Count() / 50, 1));
			foreach (int hvo in itemsToChange)
			{
				i++;
				if (i % interval == 0)
				{
					state.PercentDone = i * 100 / itemsToChange.Count();
					state.Breath();
				}
				bool fEnable = IsItemEligible(m_sda, hvo, possiblePOS);
				if (fEnable)
					m_sda.SetString(hvo, tagFakeFlid, tss);
				m_sda.SetInt(hvo, tagEnable, (fEnable ? 1 : 0));
			}
		}