Author Archive

Create an overloaded delegate quickly

Sunday, March 23rd, 2008

Sometimes it is necessary to create method overloads that just pass default values to other overloads. ReSharper allows you to do this quickly and easily.

Take this simple method for example:

screenshot_01.jpg

We need to take the CreateUser method and add a new parameter to it. However, we also need to keep the old CreateUser method signature around for other code that still uses that version of the method signature. Using ReSharper’s Change Signiture (Control-F6) feature will allow us to create an overloaded method to solve our problem.

screenshot_02.jpg

When the Change Signature dialog opens for this method, we will go ahead and add our new email parameter to this method.

screenshot_03.jpg

In the above screenshot, notice the option “Delegate via overloading method” circled in red. Clicking this box is what will take the signature changes and turn them into a new overloaded method.

When the changes are ready, clicking Next in the Change Signature dialog will now produce the following code.

screenshot_04.jpg

Notice that in the SaveNewUser method, the original method signature remains intact, but it is now delegated through an overloaded method. The CreateUser method now has two overloaded variations, the delegating method and the main method, where we can now add code to handle the new email parameter.

Jeff Pennal
JetBrains .NET Evangelist

Custom Templates

Saturday, March 15th, 2008

ReSharper templates enable you to quickly generate predefined code constructs. Many templates are provided ready to use; you can create new templates, edit existing ones and easily manage them.

Creating and using your own templates is a quick and easy way to help eliminate repetitive code or to automate common tasks. To demonstrate this functionality, I am going to show how to use custom templates to add log entries using the Apache log4net library.
(more…)

Getting Started with ReSharper 3.0 and VB.Net - The Basics

Tuesday, July 10th, 2007

With the release of ReSharper 3.0, JetBrains has added full-featured Visual Basic.Net support for a host of productivity features.

This screencast is designed to introduce some of these features to the multitude of Visual Basic.Net developers out there who can take advantage of the power and productivity of ReSharper.

Getting Started with ReSharper 3.0 and VB.Net -  The Basics

Jeff Pennal
JetBrains .NET Evangelist

Technorati tags: , , , , ,

ReSharper 3.0 EAP in Action: Cross-Language Support

Monday, June 18th, 2007

ReSharper 3.0’s extensive support of Visual Basic.NET extends all through the program. Its new cross-language functionality allows developers to use smart-navigation, search, refactoring, and other goodies across both the C# and VB.NET languages.

Check out this screencast to see ReSharper’s cross-language functionality in action!

VB-CS-Integration

Technorati tags: , , , , , ,

ReSharper 3.0 EAP in Action: VB.NET Support

Thursday, May 17th, 2007

While C# tends to get all the attention in the .NET world, Visual Basic .NET remains a popular language for many developers.

People familiar with Visual Basic.NET know that it is a *very* wordy language. There ends up being a lot more typing involved when writing your code than in most other languages, such as in C#.

The upcoming 3.0 version of ReSharper includes a number features for Visual Basic.NET developers that will allow them to speed up their development by automatically generating code for many of their most common tasks.

Check out this screencast (my first, please be gentle!) to see ReSharper’s VB.NET code generation features in action! If you want to test these features out yourself, why not download the ReSharper 3.0 EAP for FREE?

VB.NET in ReSharper 3.0

Click thumbnail to start screencast (Aprox. 5 mins.)

Technorati tags: , , , , , ,

Resharper 3.0 EAP in Action - The Todo Explorer

Wednesday, April 18th, 2007

The ReSharper 3.0 EAP has been in progress for about two weeks now. This is the first post in a series that will look in detail at some of the new features that will be available in this latest version of ReSharper.

The To-do Explorer

In Visual Studio.NET 2005, you can use the Task List window to show comments with the keyword todo in it. However, this only works with files that are open in the IDE; it’s not going to show you TODOs in other parts of your solution that you don’t currently have open, or any other keyword EXCEPT todo.
Visual Studio.NET 2005 Tasklist
The Visual Studio.NET 2005 Task List window

In ReSharper 3.0, you get the much more useful To-do Explorer. When you open this window (found in ReSharper -> Windows -> To-do Explorer), by default you see a solution-wide listing of all comments with the prefix NOTE, TODO or BUG.
ReSharper 3.0 ToDo Explorer
The new To-do Explorer window

The default keywords that the To-do explorer looks for can be changed or added to by clicking the “To-do settings” icon in the window.
To-do Explorer settings

In the settings window, you can create new keywords to search for or edit the existing keywords as you’d like. This could be useful, for example, if you have a references to JIRA tickets in your comments, like:
//PROJ-1655: The following code block was added because of a change request from a client
You could add a pattern to match the keyword “PROJ-####” and see all JIRA tickets mentioned in your code.
To-do explorer keyword editing

Editing keywords in the To-do explorer

These To-dos can also be exported to a text file and can also be grouped to make the To-dos easier to read, so you can find which projects, namespaces, directories, etc … contain To-dos.
To-do explorer view options
The To-do Explorer view options

, ,