I have a lot of code like this:
ml = this.CriteriaList.ItemByName(SC_STATIONS) as MultiList;
I'd like to replace it with
ml = (MultiList) this.CriteriaList.ItemByName(SC_STATIONS);
To that end, I went into Resharper Options, selected Custom Patterns and created a new one that has the following as the Search Pattern:
`$expr1$ as $type1$;`
with expr1
meaning the expression and type1
meaning type. The replace pattern is ($type1$) $expr1$;
.
The problem is that Resharper never finds anything that matches this custom pattern.
What am I missing here?