The enumeration of rule insertion types.
Inheritance: System.EventArgs
		private void m_insertControl_Insert(object sender, InsertEventArgs e)
		{
			ComplexConcPatternNode node = null;
			switch (((InsertOption) e.Option).Type)
			{
				case ComplexConcordanceInsertType.Morph:
					using (ComplexConcMorphDlg dlg = new ComplexConcMorphDlg())
					{
						ComplexConcMorphNode morphNode = new ComplexConcMorphNode();
						dlg.SetDlgInfo(m_cache, m_mediator, morphNode);
						if (dlg.ShowDialog((XWindow) m_mediator.PropertyTable.GetValue("window")) == DialogResult.OK)
							node = morphNode;
					}
					break;

				case ComplexConcordanceInsertType.Word:
					using (ComplexConcWordDlg dlg = new ComplexConcWordDlg())
					{
						ComplexConcWordNode wordNode = new ComplexConcWordNode();
						dlg.SetDlgInfo(m_cache, m_mediator, wordNode);
						if (dlg.ShowDialog((XWindow) m_mediator.PropertyTable.GetValue("window")) == DialogResult.OK)
							node = wordNode;
					}
					break;

				case ComplexConcordanceInsertType.TextTag:
					using (ComplexConcTagDlg dlg = new ComplexConcTagDlg())
					{
						ComplexConcTagNode tagNode = new ComplexConcTagNode();
						dlg.SetDlgInfo(m_cache, m_mediator, tagNode);
						if (dlg.ShowDialog((XWindow) m_mediator.PropertyTable.GetValue("window")) == DialogResult.OK)
							node = tagNode;
					}
					break;

				case ComplexConcordanceInsertType.Or:
					node = new ComplexConcOrNode();
					break;

				case ComplexConcordanceInsertType.WordBoundary:
					node = new ComplexConcWordBdryNode();
					break;
			}

			m_view.Select();

			if (node == null)
				return;

			SelectionHelper sel = SelectionHelper.Create(m_view);

			ComplexConcPatternNode parent;
			int index;
			GetInsertionIndex(sel, out parent, out index);
			// if the current selection is a range remove the items we are overwriting
			if (sel.IsRange)
			{
				foreach (ComplexConcPatternNode n in CurrentNodes)
					n.Parent.Children.Remove(n);
			}

			parent.Children.Insert(index, node);
			ReconstructView(parent, index, false);
		}
		/// <summary>
		/// Handles the Insert event of the m_insertionControl control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="InsertEventArgs"/> instance containing the event data.</param>
		private void m_insertionControl_Insert(object sender, InsertEventArgs e)
		{
			var option = (InsertOption) e.Option;

			var undo = string.Format(MEStrings.ksRuleUndoInsert, option);
			var redo = string.Format(MEStrings.ksRuleRedoInsert, option);

			SelectionHelper sel = SelectionHelper.Create(m_view);
			int cellId = -1;
			int cellIndex = -1;
			switch (option.Type)
			{
				case RuleInsertType.Phoneme:
					IEnumerable<IPhPhoneme> phonemes = m_cache.LangProject.PhonologicalDataOA.PhonemeSetsOS[0].PhonemesOC.OrderBy(ph => ph.ShortName);
					ICmObject phonemeObj = DisplayChooser(MEStrings.ksRulePhonemeOpt, MEStrings.ksRulePhonemeChooserLink,
						"phonemeEdit", "RulePhonemeFlatList", phonemes);
					var phoneme = phonemeObj as IPhPhoneme;
					if (phoneme == null)
						return;
					UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
						{
							cellId = InsertPhoneme(phoneme, sel, out cellIndex);
						});
					break;

				case RuleInsertType.NaturalClass:
					IEnumerable<IPhNaturalClass> natClasses = m_cache.LangProject.PhonologicalDataOA.NaturalClassesOS.OrderBy(natc => natc.ShortName);
					ICmObject ncObj = DisplayChooser(MEStrings.ksRuleNCOpt, MEStrings.ksRuleNCChooserLink,
						"naturalClassedit", "RuleNaturalClassFlatList", natClasses);
					var nc = ncObj as IPhNaturalClass;
					if (nc == null)
						return;
					UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
						{
							cellId = InsertNC(nc, sel, out cellIndex);
						});
					break;

				case RuleInsertType.Features:
					using (var featChooser = new PhonologicalFeatureChooserDlg())
					{
						SetupPhonologicalFeatureChoooserDlg(featChooser);
						featChooser.SetHelpTopic(FeatureChooserHelpTopic);
						DialogResult res = featChooser.ShowDialog();
						if (res == DialogResult.OK)
						{
							UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
								{
									IPhNCFeatures featNC = m_cache.ServiceLocator.GetInstance<IPhNCFeaturesFactory>().Create();
									m_cache.LangProject.PhonologicalDataOA.NaturalClassesOS.Add(featNC);
									featNC.Name.SetUserWritingSystem(string.Format(MEStrings.ksRuleNCFeatsName, RuleName));
									featNC.FeaturesOA = m_cache.ServiceLocator.GetInstance<IFsFeatStrucFactory>().Create();
									IPhSimpleContextNC ctxt;
									cellId = InsertNC(featNC, sel, out cellIndex, out ctxt);
									featChooser.Context = ctxt;
									featChooser.UpdateFeatureStructure();
								});
						}
						else if (res != DialogResult.Cancel)
						{
							featChooser.HandleJump();
						}
					}
					break;

				case RuleInsertType.WordBoundary:
					IPhBdryMarker wordBdry = m_cache.ServiceLocator.GetInstance<IPhBdryMarkerRepository>().GetObject(LangProjectTags.kguidPhRuleWordBdry);
					UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
						{
							cellId = InsertBdry(wordBdry, sel, out cellIndex);
						});
					break;

				case RuleInsertType.MorphemeBoundary:
					IPhBdryMarker morphBdry = m_cache.ServiceLocator.GetInstance<IPhBdryMarkerRepository>().GetObject(LangProjectTags.kguidPhRuleMorphBdry);
					UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
						{
							cellId = InsertBdry(morphBdry, sel, out cellIndex);
						});
					break;

				case RuleInsertType.Index:
					// put the clicked index in the data field
					UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
						{
							cellId = InsertIndex((int) e.Suboption, sel, out cellIndex);
						});
					break;

				case RuleInsertType.Column:
					UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
						{
							cellId = InsertColumn(sel);
						});
					break;

				case RuleInsertType.Variable:
					UndoableUnitOfWorkHelper.Do(undo, redo, m_cache.ActionHandlerAccessor, () =>
						{
							cellId = InsertVariable(sel, out cellIndex);
						});
					break;
			}

			m_view.Select();
			if (cellId != -1)
			{
				// reconstruct the view and place the cursor after the newly added item
				ReconstructView(cellId, cellIndex, false);
			}
		}