示例#1
0
 /// <summary>
 /// 根据定制特性增加ListBoxPart的子Part类型选项
 /// ZhengHao, 2008年3月11日16时29分
 /// </summary>
 private void BuildSnipAttributeCheckBoxes(PropertyInfo[] propertyInfos)
 {
     //遍历属性集合,propertyInfos含有当前模板类型所对应的页面类型的所有属性
     foreach (PropertyInfo info in propertyInfos)
     {
         object[] snipAttrs = info.GetCustomAttributes(typeof(SnipPartAttribute), false);
         if (snipAttrs.Length <= 0)
         {
             continue;//无定制属性
         }
         //SelectGroupItem sgi = new SelectGroupItem(checkBoxDisplayChannel.Name, checkBoxDisplayChannel.Text);
         //遍历定制特性
         foreach (SnipPartAttribute snipAttr in snipAttrs)
         {
             SelectGroupItem item = new SelectGroupItem(snipAttr.Name, AutoLayoutPanel.GetLanguageText(snipAttr.Text));
             item.Tag = snipAttr;
             selectGroup.Items.Add(item);
         }
     }
 }
示例#2
0
        /// <summary>
        /// 根据定制特性增加扩展的页面片工具箱中的工具
        /// Lukan, 2008年2月20日11时29分
        /// </summary>
        private ToolBox.VSTreeNode BuildSnipAttributeTreeNode(PropertyInfo[] propertyInfos, Type type)
        {
            string name = "SnipAttributeToolsGroup" + type.FullName;
            KeyValuePair <int, ToolBox.VSTreeNode> pair = new KeyValuePair <int, ToolBox.VSTreeNode>();

            if (!ThisVSTreeNodeDic.TryGetValue(name, out pair))
            {
                //定义ToolBox的一个新的节点
                ToolBox.VSTreeNode treeNode = new ToolBox.VSTreeNode();
                treeNode.Name = name;
                treeNode.Text = StringParserService.Parse("${res:Pad.Wizard.snipText}");
                treeNode.Nodes.Clear();

                //遍历属性集合,propertyInfos含有当前模板类型所对应的页面类型的所有属性
                foreach (PropertyInfo info in propertyInfos)
                {
                    object[] snipAttrs = info.GetCustomAttributes(typeof(SnipPartAttribute), false);
                    if (snipAttrs.Length <= 0)
                    {
                        continue;//无定制属性
                    }
                    //遍历定制特性
                    foreach (SnipPartAttribute snipAttr in snipAttrs)
                    {
                        ToolBox.VSTreeNode subNode = new ToolBox.VSTreeNode();
                        subNode.Name           = snipAttr.Text;
                        subNode.Text           = AutoLayoutPanel.GetLanguageText(snipAttr.Text);
                        subNode.ToolTipCaption = snipAttr.ToolTipCaption;
                        subNode.ToolTipText    = snipAttr.ToolTipText;
                        subNode.ImageIndex     = snipAttr.Index;
                        subNode.Tag            = snipAttr;
                        treeNode.Nodes.Add(subNode);
                    }
                }
                pair = new KeyValuePair <int, ToolBox.VSTreeNode>(2, treeNode);
                ThisVSTreeNodeDic.Add(treeNode.Name, pair);
            }
            return(pair.Value);
        }
示例#3
0
        /// <summary>
        /// edit by zhenhao at 2008-06-19 11:00
        /// 添加所有的专有类(定制特性)块的节点
        /// </summary>
        private void AddSpecialNodes()
        {
            specialNode.Nodes.Clear();

            Type pageType = null;

            switch (_styleType)
            {
                #region
            case StyleType.GeneralPageListPart:
            case StyleType.GeneralPageContent:
                pageType = typeof(GeneralPageXmlDocument);
                break;

            case StyleType.ProductPageListPart:
            case StyleType.ProductPageContent:
                pageType = typeof(ProductXmlDocument);
                break;

            case StyleType.ProjectPageListPart:
            case StyleType.ProjectPageContent:
                pageType = typeof(ProjectXmlDocument);
                break;

            case StyleType.InviteBiddingPageListPart:
            case StyleType.InviteBiddingPageContent:
                pageType = typeof(InviteBiddingXmlDocument);
                break;

            case StyleType.KnowledgePageListPart:
            case StyleType.KnowledgePageContent:
                pageType = typeof(KnowledgeXmlDocument);
                break;

            case StyleType.HrPageListPart:
            case StyleType.HrPageContent:
                pageType = typeof(HrXmlDocument);
                break;

            case StyleType.HomePageListPart:
                pageType = typeof(PageXmlDocument);
                break;

            default:
                break;
                #endregion
            }
            PropertyInfo[] pInfos = pageType.GetProperties();
            foreach (PropertyInfo info in pInfos)
            {
                object[] snipAttrs = info.GetCustomAttributes(typeof(SnipPartAttribute), false);
                if (snipAttrs.Length <= 0)
                {
                    continue;//无定制属性
                }
                //遍历定制特性
                foreach (SnipPartAttribute snipAttr in snipAttrs)
                {
                    TreeNode subNode = new TreeNode();
                    subNode.Name        = snipAttr.Text;
                    subNode.Text        = AutoLayoutPanel.GetLanguageText(snipAttr.Text);
                    subNode.ToolTipText = _toolTipText;
                    subNode.ImageIndex  = snipAttr.Index;
                    subNode.Tag         = snipAttr;
                    specialNode.Nodes.Add(subNode);
                }
            }
        }