Content
- Introduction
- Abstract
- Commands
- Compatibility
- Version history
EeekSoft Tool add-in is a set of useful tools packed together. Key components are Reminder, Version history and tools for generating documentation and solution statistics. Reports generated from these tools can be generated in almost any format and design can be customized too, because styles for generating reports can be added using online update.
Tools
- Reminder is tool-window added to Visual Studio. It allows you to save any text you want with solution. Comments are organized in notes that are listed in a combobox at the top of tool-window. This utility is very useful, when you want to note your ideas about program you are writing.
- Version history is a tool for creating notes about progress of developed solution. Every row contains date when it was created, name of affected project, version of project and comment.
- Documentation generator is tool for generating report about classes in your application. This tool is similar to Visual Studio .NET-Build Commented Web Pages, but in addition to this the elementary version of my add-in can generate UML class diagrams (using HTML tables).
- Statistic tools are utilities for collecting statistic information about solution. These tools include a line counter and build counter.
- Summary is a tool that can create report from all information collected by other add-in's including version history and reminder.
- Results from all tools are generated using XSL transformations or by running custom assembly. To download more of these styles you can use online update command.
Reports from tools are saved in an XML document called <Solution Name>.esd
which is stored in same folder as the .sln file. When user invokes command, the add-in executes the specified tool which updates the XML document. For displaying reports it uses one of the installed styles (this style can be chosen in the add-in options dialog). There are two types of styles for displaying results. First it is done using an XSL transformation and secondly using a .dll assembly. Styles can be downloaded and installed from the online updates website and added to add-in at runtime.
The first type of style is created using XSL transformation. This is simple method for generating an HTML type report. User can choose whether he wants result in HTML format (transformation is done while generating output using XslTransform
object) or as XML and XSLT files (transformation is done by browser).
The second type of style is program that is dynamically loaded from specified .NET assembly. This solution allows author of styles to generate report in any format with any look. If this style generates a file, it can be viewed in Internet Explorer. It can also return an address to open back to the add-in and it will open a new window inside Visual Studio .NET. This type of style may be very complicated, so the style can create a page, which is displayed in the add-in options dialog.
For example, in standard installation is this type of style used for creating output in .chm format.
As you can see above, styles for generating output can be installed and uninstalled at runtime. This command opens EeekSoft Tools online updates web page, where you can download and install new styles. When opening this page the program appends IDs of installed add-ins to the URL so the web page (written in ASP.NET) knows what add-ins are installed and generate the appropriate web page.
This command opens a dialog with options for add-in and installed styles. Pages in dialog are loaded from assemblies and added to dialog using settings in settings.xml
. Page can be internal (implements ISettings
interface) or inherits from UserControl
and has method for saving data when user clicks on OK button on dialog.
Reminder is simple tool-window, into which you can write down any comments, ideas etc. about solution. In the combobox is a list of added notes. Each note has its own font you can change by clicking on green icon on the right side. Notes are saved with solution in XML document and displayed in solution summary (if you're using standard styles).
Whole application is written in C# but for creating tool-window it uses an ATL control created by Microsoft, that hosts .NET UserControl
as described in sample ToolWindow Add-Ins sample[^]
Line counter is an utility, which counts number of lines in your sources. It's able to count number of source code lines, lines with comments, blank lines, lines with source, comments and total number of lines. Line counter also adds size of each file in solution, but this is displayed only in the solution summary (total size of source in kilobytes). File types can be configured in options dialog.
Line counter counts lines in following types of files:
- cpp This are source files with code similar to C language. This is used for calculating lines in C++,C,C# and J# sources (including header files).
- vb This are Visual Basic and Visual Basic.NET sources.
- xml This are files with HTML/XML syntax. This type is used also for counting lines in ASPX files, even thought in ASPX file can be script in other languages.
- txt This type of files contains only comments and blank lines. Every line with any text is calculated as comment.
- src This type of files contains only source code and blank lines. Every line with any text is calculated as source (This can be usefull for calulating approximate count of lines in unknown file types).
Typical output from line counter looks like this:
<solution><lines>
-->
<project name="Project Name" type="C# Project">
-->
<file name="Filename.cs" type="C# source file"
source="14" blank="7" comment="12" total="33" mixed="0" />
</project>
</lines></solution>
This is transformed using XSL transformation to output an XHTML file. Following XSL elements are used for generating summary information about lines in whole solution:
-->
<xsl:value-of select="sum(//solution/lines/project/file/@total)" />
-->
<xsl:value-of select="sum(//solution/lines/project/file/@source)" />
-->
(<xsl:value-of select="round((sum(//solution/lines/project/file/@source)*100)
div sum(//solution/lines/project/file/@total))" />%)
This command is only a part of utility for counting the project build number. Second part is invoked automatically when solution is builded and it increments build number of version in AssemblyInfo
file. When you click on this button, addin reads version numbers for each project, updates this data in the XML document and displays informations using selected output style.
While incrementing build number, the add-in finds file called AssemblyInfo
with any extension at first and then opens it and search for AssemblyVersion("...")
or AssemblyVersionAttribute("...")
(in Managed C++). The string is passed as a parameter and is then decomposed to numbers or asterisk and build (third number) which is incremented by one. If build number is missing, utility starts counting from zero.
With Visual Studio.NET you can build a very simple report about objects in your application. This report is created using XML comments in your source code. I decided to write a better class report, because I wanted to add more features to it. My report is created using the same XML comments, but it works better with C++ comments (because the VS.NET report doesn't remove third slash from xml comment
).
Informations from this report is saved in an XML document so appearance and features of displayed result depends only on the selected style. In the default style you can get result similar to the Visual Studio .NET report result, or with UML class diagram (created using HTML tables) for every class.
Default style for generating creates a .chm file. Content is generated from XML file contains links to a list of classes in solution, project and to every class/delegate/struct/enum in project organised in transparent tree structure.
Version history editor is dialog where you can add, remove and modify entries in history of project. For easy entering of new entries the add-in reads the project version when you open dialog and fill in the version when the project is selected. For better orientation the add-in uses another color for entries of each project.
This command displays version history written with the version history editor using selected output style (by default it is HTML file).
Last command is for generating summary information about the solution. This report includes a report from line counter, build counter, objects structure, version history, comments from the reminder and general solution statistics. With default settings this report is generated in .chm format.
General solution statistics is accessible only in in summary report (in standard styles) and it contains some interesting information about solution like number of classes, total size of source in kilobytes and total count of lines. These numbers are calculated in XSL transformation using this code:
-->
<xsl:value-of select="sum(//solution/lines/project/file/@total)" />
-->
<xsl:value-of select="sum(//solution/lines/project/file/@source)" />
-->
<xsl:value-of select="count(//solution/lines/project)" />
-->
<xsl:value-of select="round(sum(//solution/lines/project/file/@size) div 1024)" /> kB
-->
<xsl:value-of select="count(//structure/project/class)" />
Setup on this site is version compiled with .NET Framework 1.1 for Visual Studio.Net 7.1 (2003). If anybody can build version for Visual Studio 7, please let me know and I will make it available to download at this site.
- More informations about this project (including sample output from utilities) are available at www.eeeksoft.net/estools[^].
- 30. 6. 2003 - Posted first version of EeekSoft Tools (1.0.11)
- 30. 6. 2003 - I fixed few minor bugs. Setup on this site should work now.