Expose the underlying Regex so that the GagElementGenerator can call it directly. Gags are unique in that they can be called repeatedly on lines from the AvalonTerminal (e.g. AvalonEdit) but will never need to process a command or go through any of the additional overhead. Currently the Trigger class calls Regex.Match directory because the returned object is needed to process groups. The GagElementGenerator however can call IsMatch which doesn't need to create the Match object and simply returns a true of false.
1.) Expose the Regex as a public property.
2.) Change the GagElementGenerator to call the Regex.IsMatch method directly.
Expose the underlying
Regex
so that theGagElementGenerator
can call it directly. Gags are unique in that they can be called repeatedly on lines from theAvalonTerminal
(e.g. AvalonEdit) but will never need to process a command or go through any of the additional overhead. Currently theTrigger
class callsRegex.Match
directory because the returned object is needed to process groups. TheGagElementGenerator
however can callIsMatch
which doesn't need to create theMatch
object and simply returns atrue
offalse
.1.) Expose the
Regex
as a public property. 2.) Change theGagElementGenerator
to call theRegex.IsMatch
method directly.