Christian Hornung's Software Development Pages


Menu

ResourceToolkit addin for SharpDevelop - Features

The ResourceToolkit addin provides tooltips and code completion for resource entries in C# and VB.NET. The resource access techniques that are detected by the addin are described under "Supported resource reference types". Here are some screenshots from inside SharpDevelop that show the capabilities of the addin.

Code completion

The code completion window pops up when the beginning of a resource access is detected and shows a list with all resource keys in the accessed resource file(s). If you select one, the key name will be inserted as string literal.

Screenshot of code completion window with .NET resource access

Tooltips

Furthermore, you get a tooltip when you point on a resource reference showing the file the resource is in and its value:

Screenshot of tooltip on .NET BCL resource access

In-place string resource creation

The code completion window also contains an "Add new" entry. If you select that, a dialog window will pop up where you can enter a new string resource key and value. The new entry will be automatically added to the associated resource file without having to open the resource editor and the key will be inserted as string literal.

Screenshot of in-place string resource creation dialog

In-place string resource editing

When you right-click on a valid resource referencing expression, you will get a context menu entry depending on the state of the resource. If the resource key is found, the resource value can be edited. Otherwise, a new resource with the key in the expression can be added.

Screenshot of context menu with 'Edit resource' entry

New features since 2006-10-03 (integrated in SharpDevelop 2.1)

"Find references" and "Rename"

"Find references" and "Rename" commands are now available for resource keys.
They operate on the whole solution and can be used like the similar refactoring commands for classes.
"Rename" renames the resource key in all source files, the primary resource file and all localized resource files as long as these are in the same directory as the primary resource file.
The context menu has been changed into a submenu that has the resource key as title:

Screenshot of new resource key context menu

"Find missing resource keys" and "Find unused resource keys"

Two new commands are available in the tools menu:

Screenshot of new tools menu

"Find missing resource keys" resolves all resource references in the whole solution and then lists those where the resource key cannot be found in the resource file. However, it does not list resource keys where the resource file cannot be found.
"Find unused resource keys" also resolves all resource references in the whole solution and then lists those resource keys that are in the resource files but not referenced anywhere.
Note that keys that are referenced outside of the solution or in a way that is not understood by the ResourceToolkit addin are also listed as unused.
The unused resource keys are displayed in a new tab where one or more resource keys can be deleted from the resource files by selecting them and using the context menu or the delete button in the SharpDevelop toolbar.


Modified: 2008-07-22 Copyright © 2006-2009 Christian Hornung - chhornung@googlemail.com