예제 #1
0
		private void AddListToMenu(ToolStrip menu, ICmPossibility tagList)
		{
			Debug.Assert(tagList.SubPossibilitiesOS.Count > 0, "There should be sub-possibilities here!");

			// Add the main entry first
			ToolStripMenuItem tagSubmenu = new ToolStripMenuItem(tagList.Name.BestAnalysisAlternative.Text);
			menu.Items.Add(tagSubmenu);

			foreach (ICmPossibility poss in tagList.SubPossibilitiesOS)
			{
				// Add 'tag' BestDefaultAnalWS Name to menu
				TagPossibilityMenuItem tagItem = new TagPossibilityMenuItem(poss.Hvo);
				tagItem.Click += new EventHandler(Tag_Item_Click);
				tagItem.Text = poss.Name.BestAnalysisAlternative.Text;
				tagItem.Checked = DoSelectedXficsHaveTag(poss.Hvo);
				tagSubmenu.DropDownItems.Add(tagItem);
			}
		}