How can I easily count the number of Forms in a large solution?
I have Visual Studio solution containing 20+ winforms projects.
I have to do a task where I have to inspect every form, and I have to give an effort estimate to my project lead. This estimate is best given in terms of the number of forms. It’s useful to report progress in terms of “27/275 forms done, spend 3 hours”.
For this project, I use VS 2008 and Resharper 5.
A more general answer, for instance on “how to count the number of classes deriving from a specified class” would also be nice.
This is built into ReSharper – no code or extra tools needed. I don’t have ReSharper 5 in front of me, but on version 4.5, I’d use the menu command under ReSharper > Search > Find Usages Advanced.
From there you can generate a list of all classes that inherit from
System.Windows.Form. Then, either look at the list of search results in the IDE, or export it to a file for further inspection.