如何进行结构搜索和替换?

时间:2017-10-10 04:06:59

标签: c# .net visual-studio-2017 resharper

我有一个简短的代码片段,存在于大约一百个项目中:

        new ServiceInstanceListener(serviceContext => new OwinCommunicationListener(Startup.ConfigureApp,
            serviceContext, ServiceEventSource.Current, "ServiceEndpoint"))

我想将其替换为:

        new ServiceInstanceListener(serviceContext => new OwinCommunicationListener(Startup.ConfigureApp,
            serviceContext, ServiceEventSource.Current, "ServiceEndpointHttps"))

请注意,我要搜索的代码段可能采用不同的格式:

可能全部在一行

    new ServiceInstanceListener(serviceContext => new OwinCommunicationListener(Startup.ConfigureApp,             serviceContext, ServiceEventSource.Current, "ServiceEndpoint"))

可能有多行:

        new ServiceInstanceListener
(serviceContext => 
new OwinCommunicationListener
(Startup.ConfigureApp,
            serviceContext, 
ServiceEventSource.Current, "ServiceEndpoint"))

如何在这种情况下执行结构查找/替换?

0 个答案:

没有答案