Tags

, , , , ,

Today post is about a Visual Studio 2010 extension which make our life easier, nArrange.

It is totally free.

We could develop our application without think in spaces tabs and regions, nArrage will format our text for us just clicking or pressing a group of keys.

Here there is an example:

Before applying nArrange:

using System;
using System.Linq;
using System.Windows;

namespace DGU.Demo.PushNotifications
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

        public MainWindow()
        {

            InitializeComponent();

            JustAnExample();
        }

        private void JustAnExample()
        {
            throw new NotImplementedException();
        }

        private int _exampleProp;

        public int ExampleProperty
        {
            get { return _exampleProp; }
            set { _exampleProp = value; }
        }

    }
}

After applying nArrange:

namespace DGU.Demo.PushNotifications
{
    using System;
    using System.Linq;
    using System.Windows;

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        #region Fields

        private int _exampleProp;

        #endregion Fields

        #region Constructors

        public MainWindow()
        {
            InitializeComponent();

            JustAnExample();
        }

        #endregion Constructors

        #region Properties

        public int ExampleProperty
        {
            get { return _exampleProp; }
            set { _exampleProp = value; }
        }

        #endregion Properties

        #region Methods

        private void JustAnExample()
        {
            throw new NotImplementedException();
        }

        #endregion Methods
    }
}

Requirements:

– Visual Studio 2010

Steps to installing a setting up are:
1. Close Visual Studio before
2. download the installer from http://www.narrange.net/download.aspx
and install it.
3. Open Visual Studio 2010 and Add nArrange button to your external tools
Add nArrange button to Visual Studio
Press Add and Set-Up parameters like image above
Setting up nArrange
4. To use it just open the .cs file you want to format, save changes first and press nArrange button.

That’s everything, doing this in all your team member’s PC, everyone will have same code format and grouping.
nArrange will group code like the following regions:

Fields
Constructors
Finalizers (Destructors)
Delegates
Events
Enums
Interfaces
Properties
Indexers
Methods
Structs
Classes

Categories looks like a microsoft API class(see link above):
List Class API

Well, just give thanks to @simply_aure to show me this excellent tool.