public LineTreeRule CreateCopy(int deepth)
        {
            var rule = new LineTreeRule();

            rule.deepth           = deepth;
            rule.fontColor_normal = fontColor_normal;
            rule.horizontal       = horizontal;
            rule.vertical         = vertical;
            rule.spacing          = spacing;
            rule.normal           = normal;
            rule.mask             = mask;
            return(rule);
        }
        /// <summary>
        /// 获取指定层级的规则
        /// </summary>
        /// <param name="deepth"></param>
        /// <returns></returns>
        private LineTreeRule GetRule(int deepth)
        {
            var rule = rules.Find(x => x.deepth == deepth);

            if (rule == null)
            {
                if (rules.Count > 0)
                {
                    rule = rules[rules.Count - 1].CreateCopy(deepth);
                }
                else
                {
                    rule        = new LineTreeRule();
                    rule.deepth = deepth;
                }
            }
            return(rule);
        }
예제 #3
0
        public void InitTreeSelecter(int deepth, TreeNode node, LineTreeOption option)
        {
            this.node = node;
            var ruleget = option.ruleGetter;

            this.rule = ruleget(deepth);

            if (node.childern != null && node.childern.Length > 0)
            {
                InitContent(option.axisType);
                creater = new LineTreeItemCreater(deepth, childContent, option);
                var items = creater.CreateTreeSelectItems(node.childern.ToArray());
                foreach (var item in items)
                {
                    item.onSelection = OnSelection;
                }
            }
            else
            {
                //toggle.group = option.leafGroup;
            }

            ChargeRule();
        }