Archive for August, 2004

This is a repost from the support forums. I think I have all of the pieces for the new add-in figured out and verified. Here’s what I have in mind for the next add-in.

I often find myself trying to use one of the many FCL classes but not remembering the exact namespace it resides in and/or not having the right assembly in the reference list. The new add-in would aid with the whole type name location, namespace selection and assembly reference process. I don’t have much done at this point other than separate stand alone prototypes. And I haven’t come up with the name for the add-in yet. It could be something like FCL Browser or Assembly Browser.

The add-in’s UI would resemble Code Browser’s one. It would allow one to search the FCL assembly information for a given type. The UI would have a search box and a search button. Due to sheer volume of FCL types, one would have to explicitly hit some sort of Find button to get the results. When one selects a type from the search results grid, the type’s namespace would be added to the clipboard and its assembly would be added to the project reference list. Presumably user would go ahead and add the namespace as a ‘using’ statement. The result grid would have type name, type, namespace and assembly columns. There might be a member type filter drop down box as well.

Whenever the add-in is accessed for the first time it would cache all of the FCL types. The cache most likely will be persisted. There would be some some cache refresh mechanism put in place. The caching logic would go like this:

1. Use Fusion GAC interface to retrieve the list of all GACed assemblies
2. Filter out non-MS and old framework version assemblies (v1.0 vs. v1.1)
3. Create a separate app domain where all assemblies would be loaded into. This is required because once assemblies are loaded into a domain, they cannot be unloaded. The whole domain must be unloaded instead
4. Resolve GACed assembly paths to their physical framework paths
5. Load all assemblies and their dependencies
6. Using reflection cache all assembly types

File Browser add-in - allows one to locate and open file(s) in the solution using the file browser dialog. The file browser dialog shows all code files in all projects of the currently opened solution. The file list allows for multi-selection. The file browser dialog also allows one to filter the file list based on entered search criteria.

Surround with add-in - allows one to paste one of the commonly used code constructs to the currently opened source file. List of available code constructs varies slightly depending on currently opened file language. Cursor position in the source file directly influences where and how the code construct is pasted. The supported code constructs (similar to templates) include: “try/finally”, “try/catch”, “try/catch/finally”, “for”, “foreach”, “while”, “do/while”, “if”, “if/else”, “switch” and “#region”.