Help with Search with Pattern: Search for use of member method of a type.



I have the following code:

            class foo
            {
                 void bar()
                 {
                     var result = DateTime.Now.ToUniversalTime();
                 }
            }

I want to replace all .ToUniversalTime() call with  TimeZoneInfo.ConvertTimeToUtc
so I start out by try this simple search pattern:
$date$.ToUniversalTime();
where date is type of DateTime or derived types.

This doesn't find anything. What am I not getting with this pattern searching?
Thanks.
4 comments
Comment actions Permalink

Remove the semicolon in search pattern.

SearchPattern_ToUniversalTime.jpg

0
Comment actions Permalink

Thanks but unfortunately it didn't help.

0
Comment actions Permalink

It's a pity.
Maybe it is a version issue. I have ReSharper 5.1.

Using the pattern before replacing: see attachment UsingPatternBeforeReplacing.jpg





Using the pattern after replacing: see attachment UsingPatternAfterReplacing.jpg





Regards
Markus



Attachment(s):
UsingPatternAfterReplacing.jpg
UsingPatternBeforeReplacing.jpg
0
Comment actions Permalink

Found the issue. I didn't read your screenshots carefully, I had selected "type" instead of "expression" for the $date$ identifier. Thanks!

0

Please sign in to leave a comment.