示例#1
0
        internal int GetHeight(int i, TemplateSet ts, bool subNodes)
        {
            if ((i < 0) || (i >= base.List.Count))
            {
                return(0);
            }
            Node         node     = (Node)base.InnerList[i];
            NodeTemplate template = ts[node.CurrentTemplateIndex];

            if (template == null)
            {
                return(0);
            }
            int height = template.GetHeight(node);

            if (subNodes && node.IsExpanded)
            {
                height += node.Nodes.CalculateNodesHeight();
            }
            if (this.AdvancedTree.GridLines)
            {
                return(height + 1);
            }
            return(height);
        }
示例#2
0
        internal int Draw(Graphics gr, TemplateSet ts, int width, int ymax, int ymin, int iNode, int iNodeOffset, ref bool resetScrollbar)
        {
            int yOffset = iNodeOffset;
            int count   = base.List.Count;

            this.LastDrawnNodeOffset = yOffset;
            this.LastDrawnNode       = iNode;
            while (this.LastDrawnNode < count)
            {
                Node node = null;
                if ((this.LastDrawnNode >= 0) && (this.LastDrawnNode < base.InnerList.Count))
                {
                    node = base.InnerList[this.LastDrawnNode] as Node;
                }
                if (node != null)
                {
                    NodeTemplate template = node.GetTemplate(ts);
                    int          height   = 0;
                    int          num4     = -1;
                    int          xOffset  = node.Level * this.m_AdvancedTree.NodeIndent;
                    if (template.CustomizeCells(node))
                    {
                        num4 = template.GetHeight(node);
                        node.ResetCachedBounds(null);
                    }
                    height = template.GetHeight(node);
                    if ((num4 >= 0) && (height != num4))
                    {
                        resetScrollbar = true;
                    }
                    if ((yOffset + height) >= ymin)
                    {
                        template.Draw(gr, xOffset, yOffset, node, width, -1);
                    }
                    this.LastDrawnNodeOffset = yOffset;
                    yOffset += height;
                    if (this.AdvancedTree.GridLines)
                    {
                        if (yOffset >= 0)
                        {
                            gr.DrawLine(this.m_AdvancedTree.m_penBorder, 0, yOffset, this.AdvancedTree.Width, yOffset);
                        }
                        yOffset++;
                    }
                    if (node.IsExpanded)
                    {
                        yOffset = node.Nodes.Draw(gr, ts, width, ymax, ymin, 0, yOffset, ref resetScrollbar);
                    }
                    if (yOffset > ymax)
                    {
                        return(yOffset);
                    }
                }
                this.LastDrawnNode++;
            }
            this.LastDrawnNodeOffset = yOffset;
            return(yOffset);
        }
示例#3
0
        public virtual TemplateSet Clone()
        {
            TemplateSet set = new TemplateSet();

            foreach (NodeTemplate template in base.List)
            {
                set.Add(template);
            }
            return(set);
        }
示例#4
0
        public NodeTemplate GetTemplate(TemplateSet ts)
        {
            int currentTemplateIndex = this.CurrentTemplateIndex;

            if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
            {
                return(ts[currentTemplateIndex]);
            }
            return(NodeTemplate.Default);
        }
示例#5
0
        internal int GetHeight(TemplateSet ts)
        {
            int currentTemplateIndex = this.CurrentTemplateIndex;

            if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
            {
                return(ts[currentTemplateIndex].GetHeight(this));
            }
            return(NodeTemplate.Default.Height);
        }
示例#6
0
        internal NodeTemplate GetTemplate(Node r, int ix)
        {
            TemplateSet templates = this.AdvancedTree.Templates;
            int         count     = templates.Count;

            if ((ix >= 0) && (ix < count))
            {
                return(templates[ix]);
            }
            return(NodeTemplate.Default);
        }
示例#7
0
        internal NodeTemplate GetTemplate(Node r)
        {
            if (this.AdvancedTree == null)
            {
                return(null);
            }
            TemplateSet templates            = this.AdvancedTree.Templates;
            int         count                = templates.Count;
            int         currentTemplateIndex = r.CurrentTemplateIndex;

            if ((currentTemplateIndex >= 0) && (currentTemplateIndex < count))
            {
                return(templates[currentTemplateIndex]);
            }
            return(NodeTemplate.Default);
        }
示例#8
0
 internal int GetHeight(int i, TemplateSet ts, bool subNodes)
 {
     if ((i < 0) || (i >= base.List.Count))
     {
         return 0;
     }
     Node node = (Node) base.InnerList[i];
     NodeTemplate template = ts[node.CurrentTemplateIndex];
     if (template == null)
     {
         return 0;
     }
     int height = template.GetHeight(node);
     if (subNodes && node.IsExpanded)
     {
         height += node.Nodes.CalculateNodesHeight();
     }
     if (this.AdvancedTree.GridLines)
     {
         return (height + 1);
     }
     return height;
 }
示例#9
0
 internal int GetHeight(int i, TemplateSet ts)
 {
     return this.GetHeight(i, ts, false);
 }
示例#10
0
 internal int Draw(Graphics gr, TemplateSet ts, int width, int ymax, int ymin, int iNode, int iNodeOffset, ref bool resetScrollbar)
 {
     int yOffset = iNodeOffset;
     int count = base.List.Count;
     this.LastDrawnNodeOffset = yOffset;
     this.LastDrawnNode = iNode;
     while (this.LastDrawnNode < count)
     {
         Node node = null;
         if ((this.LastDrawnNode >= 0) && (this.LastDrawnNode < base.InnerList.Count))
         {
             node = base.InnerList[this.LastDrawnNode] as Node;
         }
         if (node != null)
         {
             NodeTemplate template = node.GetTemplate(ts);
             int height = 0;
             int num4 = -1;
             int xOffset = node.Level * this.m_AdvancedTree.NodeIndent;
             if (template.CustomizeCells(node))
             {
                 num4 = template.GetHeight(node);
                 node.ResetCachedBounds(null);
             }
             height = template.GetHeight(node);
             if ((num4 >= 0) && (height != num4))
             {
                 resetScrollbar = true;
             }
             if ((yOffset + height) >= ymin)
             {
                 template.Draw(gr, xOffset, yOffset, node, width, -1);
             }
             this.LastDrawnNodeOffset = yOffset;
             yOffset += height;
             if (this.AdvancedTree.GridLines)
             {
                 if (yOffset >= 0)
                 {
                     gr.DrawLine(this.m_AdvancedTree.m_penBorder, 0, yOffset, this.AdvancedTree.Width, yOffset);
                 }
                 yOffset++;
             }
             if (node.IsExpanded)
             {
                 yOffset = node.Nodes.Draw(gr, ts, width, ymax, ymin, 0, yOffset, ref resetScrollbar);
             }
             if (yOffset > ymax)
             {
                 return yOffset;
             }
         }
         this.LastDrawnNode++;
     }
     this.LastDrawnNodeOffset = yOffset;
     return yOffset;
 }
示例#11
0
文件: Node.cs 项目: north0808/haina
 internal int GetHeight(TemplateSet ts)
 {
     int currentTemplateIndex = this.CurrentTemplateIndex;
     if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
     {
         return ts[currentTemplateIndex].GetHeight(this);
     }
     return NodeTemplate.Default.Height;
 }
示例#12
0
文件: Node.cs 项目: north0808/haina
 public NodeTemplate GetTemplate(TemplateSet ts)
 {
     int currentTemplateIndex = this.CurrentTemplateIndex;
     if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
     {
         return ts[currentTemplateIndex];
     }
     return NodeTemplate.Default;
 }
示例#13
0
 internal int GetHeight(int i, TemplateSet ts)
 {
     return(this.GetHeight(i, ts, false));
 }
示例#14
0
 public virtual TemplateSet Clone()
 {
     TemplateSet set = new TemplateSet();
     foreach (NodeTemplate template in base.List)
     {
         set.Add(template);
     }
     return set;
 }