开发者

Viewing what interfaces a class implements in Visual Studio

开发者 https://www.devze.com 2023-01-07 06:49 出处:网络
I feel like the answer will be a \"oh, THAT button, duh\" sort of thing for me, but I can\'t figure out a quick way to do what I want, so here goes.

I feel like the answer will be a "oh, THAT button, duh" sort of thing for me, but I can't figure out a quick way to do what I want, so here goes.

I've read the best practices around always wrapping "using" statements around objects that implement IDisposable to clean them up properly, but that got me thinking: "well, how do I know it implements IDisposable?" Let's take System.Data.SqlClient.SqlConnection, for example. I can eventually figure out that it implements IDisposable by viewing the class in the object browser, then jumping to its base (System.Data.Common.DbConnection), and then expanding "Ba开发者_StackOverflowse Types" for that class.

That seems like a roundabout way to figure out if a certain interface is implemented; any quicker ways? I use Visual Studio 2008 and have ReSharper.


With resharper you can just use the Alt+Home command (Go to base symbols) on an item and that can drill you down to the base classes in a jiffy. Also consider Ctrl+Shift+F11 to Go to type of symbol

0

精彩评论

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