Viewing what interfaces a class implements in Visual Studio
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
精彩评论