PowerArgs.Cli.ConditionalKeywordHighlighter.ShouldBeHighlighted C# (CSharp) Method

ShouldBeHighlighted() public method

Returns true if the token matches the keyword and the given conditional evaluation returns true
public ShouldBeHighlighted ( RichCommandLineContext readerContext, HighlighterContext highlighterContext ) : bool
readerContext RichCommandLineContext context from the reader
highlighterContext HighlighterContext context about the current token
return bool
        public override bool ShouldBeHighlighted(RichCommandLineContext readerContext, HighlighterContext highlighterContext)
        {
            if (conditionEval(readerContext, highlighterContext))
            {
                return base.ShouldBeHighlighted(readerContext, highlighterContext);
            }
            else
            {
                return false;
            }
        }