I am using ReSharper 6.1 in VB.Net and I wanting to search for all the calls to Help.ShowHelp and put those in a wrapper.
So I have something like this.
Private Sub BtnHelpClick(sender As System.Object, e As EventArgs) Handles btnHelp.Click
Help.ShowHelp(Me, HelpFiles.AuditTables, HelpNavigator.TopicId, AudittablesContext.AuditTables)
End Sub
And I want it turned into this.
Private Sub BtnHelpClick(sender As System.Object, e As EventArgs) Handles btnHelp.Click
_navigation.ShowHelp(Me, HelpFiles.AuditTables, AudittablesContext.AuditTables)
End Sub
I tried something like this as the search pattern.
Help.ShowHelp($type1$, $type2$ , HelpNavigator.TopicId, $type3$)
- where type1 is an expression of
System.Windows.Forms.Form - where type2 is an expression of
System.String - where type3 is an expression of
System.Object
I tried more things then I care to remember. But even this doesn’t work Help.ShowHelp($type1$.
When I try Help.ShowHelp( it does find that, so I think it’s the expressions that aren’t matching anything.
Any help would be grately appreciated.
You need an argument placeholders for ShowHelp arguments like so:
Help.ShowHelp($arg1$,$arg2$,$arg3$,$arg4$);.Every argument placeholder should have exactly 1 argument.
The replace pattern is:
_navigation.ShowHelp($arg1$, $arg2$, $arg4$);Now all Help.ShowHelp calls are marked as suggestions and can be replaced.