SIL.FieldWorks.XWorks.DTMenuHandler.ShowSliceContextMenu C# (CSharp) Method

ShowSliceContextMenu() private method

private ShowSliceContextMenu ( object sender, SliceMenuRequestArgs e ) : ContextMenu
sender object
e SIL.FieldWorks.Common.Framework.DetailControls.SliceMenuRequestArgs
return System.Windows.Forms.ContextMenu
		public ContextMenu ShowSliceContextMenu(object sender, SliceMenuRequestArgs e)
		{
			Slice slice = e.Slice;
			return MakeSliceContextMenu(slice, e.HotLinksOnly);
			// We want something like the following (See LT-2310), but the following code does not work
			// because the menu returned by MakeSliceContextMenu has no items; they are created by an event handler
			// when the menu pops up. There's no way to get at them until then, which is too late. We will have to
			// refactor so we can merge the configuration nodes for the multiple menus.
			//			int index = slice.IndexInContainer;
			//			int indent = slice.Indent;
			//			while (indent > 0)
			//			{
			//				indent--;
			//				index = slice.Container.PrevFieldAtIndent(indent, index);
			//				Slice parentSlice = (Slice)Parent.Controls[index];
			//				ContextMenu parentMenu = MakeSliceContextMenu(parentSlice);
			//				if (parentMenu == null)
			//					continue;
			//				if (menu == null)
			//				{
			//					menu = parentMenu;
			//					continue;
			//				}
			//				menu.MenuItems.Add("---");
			//				Debug.WriteLine("Added --- to menu");
			//				foreach (MenuItem item in parentMenu.MenuItems)
			//					menu.MenuItems.Add(item.CloneMenu());
			//			}
			//we need to stash away this information so that when we receive a command
			//from the menu system, we can associate it with the slice that sent it
			//m_sourceOfMenuCommandSlice = e.Slice;
			//			return menu;
			//nono, this happens immediately m_sourceOfMenuCommandSlice= null;

		}