Used for Interlinear context menu items to Add a new WritingSystem for a flid that is already visible.
Наследование: System.Windows.Forms.ToolStripMenuItem
Пример #1
0
        private void AddAdditionalWsMenuItem(ToolStripMenuItem addSubMenu,
                                             InterlinLineChoices curLineChoices, int ilineChoice)
        {
            var curSpec             = curLineChoices[ilineChoice];
            var choices             = GetWsComboItems(curSpec);
            var curFlidDisplayedWss = curLineChoices.OtherWritingSystemsForFlid(curSpec.Flid, 0);
            var curRealWs           = GetRealWsFromSpec(curSpec);

            if (!curFlidDisplayedWss.Contains(curRealWs))
            {
                curFlidDisplayedWss.Add(curRealWs);
            }
            var lgWsAcc = Cache.LanguageWritingSystemFactoryAccessor;

            foreach (var item in choices)
            {
                var itemRealWs = lgWsAcc.GetWsFromStr(item.Id);
                // Skip 'Magic' wss and ones that are already displayed
                if (itemRealWs == 0 || curFlidDisplayedWss.Contains(itemRealWs))
                {
                    continue;
                }
                var menuItem = new AddWritingSystemMenuItem(curSpec.Flid, itemRealWs);
                menuItem.Text   = item.ToString();
                menuItem.Click += new EventHandler(addWsToFlidItem_Click);
                addSubMenu.DropDownItems.Add(menuItem);
            }
        }
Пример #2
0
		private void AddAdditionalWsMenuItem(ToolStripMenuItem addSubMenu,
			InterlinLineChoices curLineChoices, int ilineChoice)
		{
			var curSpec = curLineChoices[ilineChoice];
			var choices = GetWsComboItems(curSpec);
			var curFlidDisplayedWss = curLineChoices.OtherWritingSystemsForFlid(curSpec.Flid, 0);
			var curRealWs = GetRealWsFromSpec(curSpec);
			if (!curFlidDisplayedWss.Contains(curRealWs))
				curFlidDisplayedWss.Add(curRealWs);
			var lgWsAcc = Cache.LanguageWritingSystemFactoryAccessor;
			foreach (var item in choices)
			{
				var itemRealWs = lgWsAcc.GetWsFromStr(item.Id);
				// Skip 'Magic' wss and ones that are already displayed
				if (itemRealWs == 0 || curFlidDisplayedWss.Contains(itemRealWs))
					continue;
				var menuItem = new AddWritingSystemMenuItem(curSpec.Flid, itemRealWs);
				menuItem.Text = item.ToString();
				menuItem.Click += new EventHandler(addWsToFlidItem_Click);
				addSubMenu.DropDownItems.Add(menuItem);
			}
		}