Esempio n. 1
0
        private void GetInfoFontAndBrush(Core.Ent ent, int i, out Font font, out Brush brush)
        {
            bool direct = (ent.ActualWinner == ent.Winner);

            if (ent.ActualWinner == Core.WinnerPreserve)
            {
                font  = treeView.Font;
                brush = new SolidBrush(direct ? Color.Black : Color.Gray);
            }
            else if (ent.ActualWinner == i)
            {
                font  = treeView.Font;
                brush = new SolidBrush(direct ? Color.Blue : Color.DarkBlue);
            }
            else
            {
                font  = new Font(treeView.Font, FontStyle.Strikeout);
                brush = new SolidBrush(direct ? Color.Red : Color.DarkRed);
            }
        }
Esempio n. 2
0
        private void treeView_DrawNode(object sender, DrawTreeNodeEventArgs e)
        {
            int colstart = 500;
            int colwidth = 100;

            Core.Ent ent = (Core.Ent)e.Node.Tag;

            e.Graphics.FillRectangle(new SolidBrush(treeView.BackColor), e.Bounds);
            e.Graphics.DrawString(ent.Name, treeView.Font, new SolidBrush(SelectedNodes.Contains(e.Node) ? Color.Green : Color.Black), new Point(e.Bounds.X, e.Bounds.Y));
            for (int i = 0; i < ent.Infos.Length; i++)
            {
                Font  font;
                Brush brush;
                GetInfoFontAndBrush(ent, i, out font, out brush);
                if (ent.Infos[i] != null)
                {
                    e.Graphics.DrawString(DescribeInfo(ent.Infos[i]), font, brush,
                                          new Point(colstart + i * colwidth, e.Bounds.Y));
                }
            }
        }