private void tvCrafts_DrawControl(object o, DrawEventArgs e)
        {
            CraftNode node = (CraftNode)e.Node.Tag;
            if (e.Text != node.Name)
                return;

            e.TextColor = Color.Black;

            if (node.IsInvalidOrHasInvalidChilds)
                e.TextColor = Color.FromArgb(255, 0, 0);
        }
        private void tvModSelection_DrawControl(object sender, DrawEventArgs e)
        {
            var node = (ModNode)e.Node.Tag;
            e.TextColor = Color.Black;

            if (!node.ZipExists)
                e.TextColor = OptionsController.ColorModArchiveMissing;

            if (node.IsInstalled || node.HasInstalledChilds)
            {
                if (node.Text.Equals(Constants.GAMEDATA, StringComparison.CurrentCultureIgnoreCase))
                {
                    if (node.HasInstalledChilds)
                        e.TextColor = OptionsController.ColorModInstalled;
                }
                else
                    e.TextColor = OptionsController.ColorModInstalled;
            }
            else if (!node.HasDestination && !node.HasDestinationForChilds)
                e.TextColor = OptionsController.ColorDestinationMissing;
            if (OptionsController.Color4OutdatedMods && node.IsOutdated)
                e.TextColor = OptionsController.ColorModOutdated;
            if (!node.ZipExists)
                e.TextColor = OptionsController.ColorModArchiveMissing;
            if (OptionsController.ConflictDetectionOnOff && (node.HasChildCollision || (node.IsFile && node.HasCollision)))
                e.TextColor = OptionsController.ColorDestinationConflict;
        }
 protected virtual void OnDrawControl(DrawEventArgs args)
 {
     if (DrawControl != null)
         DrawControl(this, args);
 }
 internal void FireDrawControl(DrawEventArgs args)
 {
     OnDrawControl(args);
 }
 protected virtual void OnDrawText(DrawEventArgs args)
 {
     TreeViewAdv tree = args.Node.Tree;
     if (tree != null)
         tree.FireDrawControl(args);
     if (DrawText != null)
         DrawText(this, args);
 }
        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 (DrawTextMustBeFired(node))
            {
                DrawEventArgs args = new DrawEventArgs(node, this, context, text);
                args.Text = label;
                args.TextColor = textColor;
                args.BackgroundBrush = backgroundBrush;
                args.Font = font;

                OnDrawText(args);

                textColor = args.TextColor;
                backgroundBrush = args.BackgroundBrush;
                font = args.Font;
                label = args.Text;
            }
        }
 protected Font GetDrawingFont(TreeNodeAdv node, DrawContext context, string label)
 {
     Font font = context.Font;
     if (DrawTextMustBeFired(node))
     {
         DrawEventArgs args = new DrawEventArgs(node, this, context, label);
         args.Font = context.Font;
         OnDrawText(args);
         font = args.Font;
     }
     return font;
 }