public override void SetStyle(TreeNodeCellStyles styles)
 {
     _text.Style.Font = styles.Font;
     if (IsSelected)
     {
         _text.Style.ForeColor = styles.Selected.ForeColor;
         _currentBackColor     = _text.Style.BackColor = styles.Selected.BackColor;
     }
     else if (IsHot)
     {
         _text.Style.ForeColor = styles.Hot.ForeColor;
         _currentBackColor     = _text.Style.BackColor = styles.Hot.BackColor;
     }
     else
     {
         _text.Style.ForeColor = styles.Default.ForeColor;
         _currentBackColor     = _text.Style.BackColor = styles.Default.BackColor;
     }
 }
Ejemplo n.º 2
0
 public override void SetStyle(TreeNodeCellStyles styles)
 {
     base.SetStyle(styles);
     // level 0
     // name
     _name.Style.Margins = new Thickness(1);
     _name.Style.Font    = new Font("Calibri", 10, FontStyle.Bold);
     // description
     _description.Style.Margins  = new Thickness(1);
     _description.Style.Font     = new Font("Calibri", 9, FontStyle.Italic);
     _description.Style.WordWrap = true;
     // img
     _img.Style.ImageScaling   = ImageScaling.Scale;
     _img.Style.ImageAlignment = ImageAlignment.CenterCenter;
     // level 1
     _product.Style.Font                = new Font("Calibri", 10, FontStyle.Bold);
     _product.Style.Margins             = new Thickness(2);
     _product.Style.HorizontalAlignment = Alignment.Center;
     _product.Style.VerticalAlignment   = Alignment.Center;
 }
Ejemplo n.º 3
0
 public override void SetStyle(TreeNodeCellStyles styles)
 {
     base.SetStyle(styles);
     // level 0
     _count.Style.HorizontalAlignment = Alignment.Center;
     _count.Style.VerticalAlignment   = Alignment.Center;
     _count.Style.Font = new Font("Calibri", 11, FontStyle.Bold);
     // level 1
     _unitPrice.Style.Font = new Font(_eStyle.Font, FontStyle.Bold);
     if (_unitInStock.Text == "0")
     {
         _unitInStock.Style.ForeColor = Color.Red;
         _unitInStock.Style.Font      = new Font(_eStyle.Font, FontStyle.Bold);
     }
     if (_unitsOnOrder.Text == "0")
     {
         _unitsOnOrder.Style.ForeColor = Color.Red;
         _unitsOnOrder.Style.Font      = new Font(_eStyle.Font, FontStyle.Bold);
     }
 }
            public override void SetStyle(TreeNodeCellStyles styles)
            {
                // let's highlight the small values in red
                float min = Node.Level == 0? 7000f: 500f;
                // let's highlight the large values in Green
                float max = Node.Level == 0 ? 14000f : 1000f;

                System.Drawing.Color c;
                if (_value < min && _value >= 0)
                {
                    c = System.Drawing.Color.Red;
                }
                else if (_value > max)
                {
                    c = System.Drawing.Color.Green;
                }
                else
                {
                    c = Node.Selected ? styles.Selected.ForeColor : styles.Default.ForeColor;
                }
                _text.Style.ForeColor = c;
            }
 public override void SetStyle(TreeNodeCellStyles styles)
 {
     base.SetStyle(styles);
     _textElement.Style.Font = styles.Font;
 }
Ejemplo n.º 6
0
 public override void SetStyle(TreeNodeCellStyles styles)
 {
     _hyperLink.Style.Font = styles.Font;
 }