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); }
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); }
public virtual TemplateSet Clone() { TemplateSet set = new TemplateSet(); foreach (NodeTemplate template in base.List) { set.Add(template); } return(set); }
public NodeTemplate GetTemplate(TemplateSet ts) { int currentTemplateIndex = this.CurrentTemplateIndex; if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count)) { return(ts[currentTemplateIndex]); } return(NodeTemplate.Default); }
internal int GetHeight(TemplateSet ts) { int currentTemplateIndex = this.CurrentTemplateIndex; if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count)) { return(ts[currentTemplateIndex].GetHeight(this)); } return(NodeTemplate.Default.Height); }
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); }
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); }
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; }
internal int GetHeight(int i, TemplateSet ts) { return this.GetHeight(i, ts, false); }
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; }
internal int GetHeight(TemplateSet ts) { int currentTemplateIndex = this.CurrentTemplateIndex; if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count)) { return ts[currentTemplateIndex].GetHeight(this); } return NodeTemplate.Default.Height; }
public NodeTemplate GetTemplate(TemplateSet ts) { int currentTemplateIndex = this.CurrentTemplateIndex; if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count)) { return ts[currentTemplateIndex]; } return NodeTemplate.Default; }
internal int GetHeight(int i, TemplateSet ts) { return(this.GetHeight(i, ts, false)); }
public virtual TemplateSet Clone() { TemplateSet set = new TemplateSet(); foreach (NodeTemplate template in base.List) { set.Add(template); } return set; }