Esempio n. 1
0
		private void DeleteCharts(int hvoStText, Set<int> objectsToDeleteAlso,
			SIL.FieldWorks.Common.Controls.ProgressState state)
		{
			// Enhance GordonM: When we add other subclasses of DsChart, we'll need to delete them too.
			if (m_cache.LangProject.DiscourseDataOA == null)
				return;
			if (m_cache.LangProject.DiscourseDataOA.ChartsOC == null)
				return;
			if (m_cache.LangProject.DiscourseDataOA.ChartsOC.Count == 0)
				return;
			state.SetMilestone(Strings.ksDeletingCharts);
			foreach (DsConstChart chart in m_cache.LangProject.DiscourseDataOA.ChartsOC)
			{
				if (chart.BasedOnRAHvo == hvoStText)
				{
					// We've found a chart on the Text that's going away.
					foreach (CmIndirectAnnotation ccr in chart.RowsRS)
					{
						objectsToDeleteAlso.AddRange(ccr.AppliesToRS.HvoArray);
						objectsToDeleteAlso.Add(ccr.Hvo);
					}
					objectsToDeleteAlso.Add(chart.Hvo);
					state.Breath();
				}
			}
		}