As i have a weird problem with converting strings to booleans i wanted to replace all CBool() calls in my solution with an own implementation. I usedefined the pattern
where $value$ is defined as identifier.
If i search this, R# also returns occurences of the other VB conversion functions like CStr(), CInt() and so on.
The application is an old VB6 application which was migrated to .NET. The old VB6 application made heavy use of the Varianrt type, so most of the variable are declared of type Object now. I tried to change the pattern like this:
$result$ = CBool($value$)
and defined $result$ as expression of type Boolean. With ths pattern only calls of CBool() are found, but as most of the calls have a variable of type Object on the left the result is'nt satisfying.
I expect that R# takes the fix parts in the pattern as it is, but this don't seems so. Is this behavior by design? And if yes, how can i restrict the pattern that i only get calls of CBool()?