예제 #1
0
		protected override void OnSelectionChange()
		{
			base.OnSelectionChange();

			if (m_ToolStripAttributeLevelMenu != null)
			{
				// Enable 'attribute level' if placeholder is selected
				var selText = GetTextRange();

				string placeholderText;
				int level;

				if (HtmlReportUtils.ParsePlaceholder(selText, out placeholderText, out level) &&
					!placeholderText.Equals("indent"))
				{
					m_ToolStripAttributeLevelMenu.Enabled = true;

					CommandHandling.ClearChecked(m_ToolStripAttributeLevelMenu.DropDownItems);

					ToolStripItem item = m_ToolStripAttributeLevelMenu.DropDownItems[level.ToString()];

					if (item != null && item is ToolStripMenuItem)
						(item as ToolStripMenuItem).Checked = true;
				}
				else
				{
					m_ToolStripAttributeLevelMenu.Enabled = false;
				}
			}
		}
		protected override void OnSelectionChange()
		{
			base.OnSelectionChange();

			// update menu check-state
			CommandHandling.ClearChecked(m_ToolStripAttributeMenu.DropDownItems);
			
			var selText = GetTextRange();

			string basePlaceholder;
			int level;

			if (HtmlReportUtils.ParsePlaceholder(selText, out basePlaceholder, out level))
			{
				ToolStripItem item = m_ToolStripAttributeMenu.DropDownItems[HtmlReportUtils.FormatPlaceholder(basePlaceholder)];

				if ((item != null) && (item is ToolStripMenuItem))
					(item as ToolStripMenuItem).Checked = true;
			}
		}