예제 #1
0
        /// <summary>
        /// 创建菜单项
        /// </summary>
        /// <param name="node">节点</param>
        /// <param name="menu">菜单</param>
        /// <param name="parentItem">父节点</param>
        protected override void createMenuItem(XmlNode node, FCMenu menu, FCMenuItem parentItem)
        {
            FCMenuItem item = new FCMenuItem();

            item.Native = Native;
            item.Font   = new FCFont("微软雅黑", 12, false, false, false);
            setAttributesBefore(node, item);
            if (parentItem != null)
            {
                parentItem.addItem(item);
            }
            else
            {
                menu.addItem(item);
            }
            if (node.ChildNodes != null && node.ChildNodes.Count > 0)
            {
                foreach (XmlNode subNode in node.ChildNodes)
                {
                    createMenuItem(subNode, menu, item);
                }
            }
            setAttributesAfter(node, item);
            onAddControl(item, node);
        }
예제 #2
0
        /// <summary>
        /// 创建菜单项
        /// </summary>
        /// <param name="node">节点</param>
        /// <param name="menu">菜单</param>
        /// <param name="parentItem">父项</param>
        protected virtual void createMenuItem(XmlNode node, FCMenu menu, FCMenuItem parentItem)
        {
            FCMenuItem item = new FCMenuItem();

            item.Native = m_native;
            setAttributesBefore(node, item);
            if (parentItem != null)
            {
                parentItem.addItem(item);
            }
            else
            {
                menu.addItem(item);
            }
            if (node.ChildNodes != null && node.ChildNodes.Count > 0)
            {
                foreach (XmlNode subNode in node.ChildNodes)
                {
                    createMenuItem(subNode, menu, item);
                }
            }
            setAttributesAfter(node, item);
            onAddControl(item, node);
        }