Esempio n. 1
0
 internal void SetAdvancedTree(Resco.Controls.AdvancedTree.AdvancedTree at)
 {
     if (this.m_AdvancedTree != null)
     {
         this.Changed = (TreeChangedEventHandler)Delegate.Remove(this.Changed, new TreeChangedEventHandler(this.m_AdvancedTree.OnChanged));
     }
     this.m_AdvancedTree = at;
     if (this.m_AdvancedTree != null)
     {
         foreach (Node node in base.List)
         {
             node.Nodes.SetAdvancedTree(this.m_AdvancedTree);
         }
         this.Changed = (TreeChangedEventHandler)Delegate.Combine(this.Changed, new TreeChangedEventHandler(this.m_AdvancedTree.OnChanged));
     }
 }
Esempio n. 2
0
        public override int GetAutoHeight(Node n, int index, NodeSpecificCellProperties preNscp)
        {
            int num = 0;

            if (!base.AutoHeight)
            {
                return(base.Bounds.Height);
            }
            NodeSpecificCellProperties properties = (preNscp == null) ? base.GetNodeSpecificProperties(n) : preNscp;

            if (properties.CachedAutoHeight >= 0)
            {
                return(properties.CachedAutoHeight);
            }
            string text = this.GetText(base[n, index]);

            if (((text == null) || (text.Length == 0)) || !properties.Visible.Value)
            {
                return(0);
            }
            int gridWidth = 0;

            Resco.Controls.AdvancedTree.AdvancedTree parent = base.Parent;
            if (parent != null)
            {
                gridWidth = parent.Width - ((n.Level * parent.NodeIndent) + parent.PlusMinusSize.Width);
                if (parent.ScrollbarVisible)
                {
                    gridWidth -= parent.ScrollbarWidth;
                }
            }
            if (gridWidth != 0)
            {
                Rectangle rectangle = base.CalculateCellWidth(gridWidth);
                rectangle.Width -= 3;
                if (rectangle.Width > base.Parent.ScrollbarWidth)
                {
                    WrapTextData data = Utility.WrapText(base.Graphics, text, this.m_Font, rectangle.Width);
                    num = (data != null) ? (data.Height + 2) : 0;
                }
            }
            properties.CachedAutoHeight = num;
            return(num);
        }
Esempio n. 3
0
 internal void SetAdvancedTree(Resco.Controls.AdvancedTree.AdvancedTree at)
 {
     if (this.m_AdvancedTree != null)
     {
         this.Changed = (TreeChangedEventHandler) Delegate.Remove(this.Changed, new TreeChangedEventHandler(this.m_AdvancedTree.OnChanged));
     }
     this.m_AdvancedTree = at;
     if (this.m_AdvancedTree != null)
     {
         foreach (Node node in base.List)
         {
             node.Nodes.SetAdvancedTree(this.m_AdvancedTree);
         }
         this.Changed = (TreeChangedEventHandler) Delegate.Combine(this.Changed, new TreeChangedEventHandler(this.m_AdvancedTree.OnChanged));
     }
 }