Exemplo n.º 1
0
		public NodeMenuItem(string text, TreeNode tn, NodeDef parentNode, NodeDef childNode, Popup popup)
			: base(text)
		{
			this.tn = tn;
			this.parentNode = parentNode;
			this.childNode = childNode;
			this.popup = popup;
		}
Exemplo n.º 2
0
        protected void BuildChildPopups(NodeMenuItem nmi, Popup popup, TreeNode tn, NodeDef n, NodeDef refNode)
        {
            foreach (Popup childPopup in popup.PopupItems)
            {
                NodeMenuItem nmiChild = new NodeMenuItem(childPopup.Text, tn, n, refNode, childPopup);

                if (childPopup.PopupItems.Count == 0)
                {
                    nmiChild.Click += new EventHandler(OnContextItem);
                    nmiChild.Enabled = ((NodeInstance)tn.Tag).Instance.IsEnabled(childPopup.Tag, childPopup.Enabled);
                }

                BuildChildPopups(nmiChild, childPopup, tn, n, refNode);
                nmi.MenuItems.Add(nmiChild);
            }
        }