开发者

resharper search with pattern for using(... new System.Data.Linq.DataContext)

I am attempting to search for

using (var context = new $DataContext$())

where DataContext is any class that extends System.Data.Linq.DataContext using Resharpers 'Search with Pattern'.

The pattern I'm using is:

using($ty开发者_StackOverflow社区pe$ $var$ = new $type$($args$))
{
  $stmt$
}

resharper search with pattern for using(... new System.Data.Linq.DataContext)

This appears to return all using statements, eg using StreamWriter, using FileStream, things that clearly do not derive from System.Data.Linq.DataContext

How can you return only the types indicated?

I am using VS 2010 SP1 Beta and ReSharper 5.1 C# Edition build 5.1.1727.12


I suggest you file it as a bug, because the following returns the expected results:

$type$ $var$ = new $type$($args$);

(Settings like you showed them).
It returns only this line:

var context2 = new DataContext("");

But not this:

var stream2 = new FileStream("", FileMode.CreateNew);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜