ZForge.Controls.TreeViewAdv.Tree.NodeControls.BaseTextControl.CreateBrushes C# (CSharp) Method

CreateBrushes() private method

private CreateBrushes ( TreeNodeAdv node, DrawContext context, string text, Brush &backgroundBrush, Color &textColor, Font &font, string &label ) : void
node TreeNodeAdv
context DrawContext
text string
backgroundBrush System.Drawing.Brush
textColor Color
font System.Drawing.Font
label string
return void
        private void CreateBrushes(TreeNodeAdv node, DrawContext context, string text, out Brush backgroundBrush, out Color textColor, out Font font, ref string label)
        {
            textColor = SystemColors.ControlText;
            backgroundBrush = null;
            font = context.Font;
            if (context.DrawSelection == DrawSelectionMode.Active)
            {
                textColor = SystemColors.HighlightText;
                backgroundBrush = SystemBrushes.Highlight;
            }
            else if (context.DrawSelection == DrawSelectionMode.Inactive)
            {
                textColor = SystemColors.ControlText;
                backgroundBrush = SystemBrushes.InactiveBorder;
            }
            else if (context.DrawSelection == DrawSelectionMode.FullRowSelect)
                textColor = SystemColors.HighlightText;

            if (!context.Enabled)
                textColor = SystemColors.GrayText;

            if (DrawText != null)
            {
                DrawEventArgs args = new DrawEventArgs(node, context, text);
                args.TextColor = textColor;
                args.BackgroundBrush = backgroundBrush;
                args.Font = font;

                OnDrawText(args);

                textColor = args.TextColor;
                backgroundBrush = args.BackgroundBrush;
                font = args.Font;
                label = args.Text;
            }
        }