SIL.FieldWorks.FdoUi.BulkEditBarPhonologicalFeatures.ShowPreviewItems C# (CSharp) Method

ShowPreviewItems() protected method

protected ShowPreviewItems ( SIL.FieldWorks.Common.Controls.ProgressState state ) : void
state SIL.FieldWorks.Common.Controls.ProgressState
return void
		protected override void ShowPreviewItems(ProgressState state)
		{
			m_bv.BrowseView.Vc.MultiColumnPreview = false;
			var itemsToChange = ItemsToChange(false);
			BulkEditItem bei = m_beItems[m_itemIndex];
			var phonFeatEditor = bei.BulkEditControl as PhonologicalFeatureEditor;
			if (phonFeatEditor == null)
			{ // User chose to remove the targeted feature
				bei.BulkEditControl.FakeDoit(itemsToChange, XMLViewsDataCache.ktagAlternateValue,
											 XMLViewsDataCache.ktagItemEnabled, state);
			}
			else
			{
				if (!phonFeatEditor.SelectedItemIsFsFeatStruc)
				{ // User chose one of the values of the targeted feature
					phonFeatEditor.FakeDoit(itemsToChange, XMLViewsDataCache.ktagAlternateValue,
											XMLViewsDataCache.ktagItemEnabled, state);
				}
				else
				{   // User built a FsFeatStruc with the features and values to change.
					// This means we have to find the columns for each feature in the FsFeatStruc and
					// then show the change for that feature in that column.
					int selectedHvo = phonFeatEditor.SelectedHvo;
					string selectedLabel = phonFeatEditor.SelectedLabel;

					string[] featureValuePairs = phonFeatEditor.FeatureValuePairsInSelectedFeatStruc;
					var featureAbbreviations = featureValuePairs.Select(s =>
																			{
																				int i = s.IndexOf(":");
																				return s.Substring(0, i);
																			});
					m_bv.BrowseView.Vc.MultiColumnPreview = true;
					for (int iColumn = 0; iColumn < m_beItems.Count(); iColumn++)
					{
						if (m_beItems[iColumn] == null)
							continue;

						var pfe = m_beItems[iColumn].BulkEditControl as PhonologicalFeatureEditor;
						if (pfe != null)
						{
							pfe.ClearPreviousPreviews(itemsToChange, XMLViewsDataCache.ktagAlternateValueMultiBase + iColumn + 1);
							if (featureAbbreviations.Contains(pfe.FeatDefnAbbr))
							{
								int tempSelectedHvo = pfe.SelectedHvo;
								pfe.SelectedHvo = selectedHvo;
								string tempSelectedLabel = pfe.SelectedLabel;
								pfe.SelectedLabel = selectedLabel;
								pfe.FakeDoit(itemsToChange, XMLViewsDataCache.ktagAlternateValueMultiBase + iColumn + 1,
											 XMLViewsDataCache.ktagItemEnabled, state);
								pfe.SelectedHvo = tempSelectedHvo;
								pfe.SelectedLabel = tempSelectedLabel;
							}
						}
					}
				}
			}
		}
		protected override void Dispose(bool disposing)