Visual Studio 2015 Feature Series #1 Account Management
Visual Studio 2015 Feature Series #2 Window Layouts
Abstract
An IDE’s Code Editor is every developer’s playground. Being a developer requires a lot of seeing, thinking and coding of course. This is the place where most of our time is spent in various activities. I learned that small things make big difference. This article will explain some of the code editor enhancements made in Visual Studio 2015 to improve developer’s productivity; which will help the developers to code better, to see better and even have better touch support if you are working on a touch enabled device.
Colored Tool Tips
Tool tip is a useful feature when a developer want to look at preview of a code segment; by placing mouse pointer over the collapsed construct such as class definitions, structure definitions, and method bodies. Visual Studio 2015 enhances the too tip view by showing colors as per the usage of code, keywords and types etc. If you hover mouse on a type and observe the preview generated then you will notice that code is hard to read and figure out the type, keywords and code etc. are in plain black color as shown below in Figure-1.

Figure-1: Plain Black Tool tip preview in Visual Studio 2013 This has served the purpose for many years but it doesn’t give proper visual clues on types, keywords and code used. Now let’s have a look at Visual Studio 2015 Tool tip as shown in Figure-2 below.

Figure-2: Colored Tool tip preview in Visual Studio 2015

Light Bulb and Quick Actions

Writing code is not easy and at times, some small productivity enhancement tips have big impact and give you some free time and take you away from thinking through of everything in terms of solving every error. What if Visual Studio code editor can itself suggest some actions; to resolve the issue? For instance, have a look at the Figure-3 shown below in which Visual Studio 2013 is showing an error when used ITest; which requires to explore some possible options to fix the issue on your own.

Figure-3 Visual Studio 2013 Now, consider the same scenario in Visual Studio 2015, when you hover mouse on ITest then you will see a “Light Bulb” which will lead you to possible solutions, and this is really productive way of programming.  Figure-4 Visual Studio 2015, Light Bulb

Removing Un-used Using

One of the best coding practice is to remove all un-used using statements from your code. The easiest way for a developer has always been to use the option “Organize Usings” because Visual Studio code editor was not telling you while coding; that which using is not being used. I.e. as shown in Figure-5 below shows that all using are being used until a developer try to invoke “Organize Usings”.

Figure-5 using in Visual Studio 2013 Visual Studio 2015 made this using business very institutive and developer friendly, so as soon as you start adding using statements you will know immediately if that is being used or not and you can remove those very quickly with much fewer steps in comparison to prior Visual Studio code editors.

Figure – 6 Greyed out using statements in Visual Studio 2015 Now, it’s also easy to remove un-used using statements. Just hover mouse on using statements and click on the “Light Bulb”.

Figure – 7 Using Light Bulb to remove un-used using statements

Inline Rename

I have personally found that “Rename” is the most widely used Refactoring option as many times you want to rename something in your code either due to self-realization or to address a code reviewer comment. Before Visual Studio 2015, the “Rename Workflow” was quite tedious and lengthy workflow, let’s quickly have a look via Visual Studio 2013. Let’s say in the code below; we want to rename msg variable to message and preview the changes before it’s applied on the code. static void Main(string[] args) { string msg = “Hello from C# Console App”; Console.WriteLine(msg); } In Visual Studio 2013, you need to hover on msg, Right-click and select Refacor à Rename then a dialog will pop-up as shown in Figure-8 below.

Figure-8 Visual Studio 2013 Refactor à Rename Now when you proceed by clicking on OK button, the workflow continues and you will see a screen as shown in Figure-9 below, highlighting all potential changes to be made if you choose to Apply rename on those.

Figure-9 Visual Studio 2013 Preview Changes (Rename) After changes are applied across the code, the code will now appear as shown below classProgram { static void Main(string[] args) { // msg Renamed to message string message = “Hello from C# Console App”; Console.WriteLine(message); } } Now let’s review this Rename process through Visual Studio 2015, in Visual Studio 2015 Rename option is available right away in the context menu as shown in Figure 10 below.

 

Rename from context menu Now when you click on the Rename it will highlight all the msg instances in code as shown in Figure-11 below.

Figure – 11 Preview of rename in action

Now click on msg (First green selected instance) and start renaming it to message for instance as shown in Figure-12 below. 

Figure – 12 Inlined Rename in action

If you want to proceed with the code changes then click “Apply” on the dialog shown in code editor window and now code will be shown as below. classProgram { staticvoid Main(string[] args) { // msg Renamed to message string message = “Hello from C# Console App”; Console.WriteLine(message); } }

Touch Gestures

Touch Gestures is a powerful feature and can come handy occasionally; especially when you are either doing some R&D or reviewing a code or thinking of code enhancements using a touch-enabled device. If you are not coding and want to read through code and performs some basic operations then following touch gestures are supported by Visual Studio 2015 on a touch-enabled device.

  • Pinch and zoom; to zoom in and out with thumb and index fingers.
  • Single tap the margin of the code editor to select the line of code where you tapped.
  • Double-tap a word or an identifier to select it.
  • Press and hold on empty screen area to open the context menu.
  • Tap and hold anywhere on the code editor’s surface to scroll up and down.

 

 

Read Feature#1 Account Management in my previous article.

Abstract

Window Layout is a new Visual Studio 2015 feature related to developer’s productivity and ease of interaction with Visual Studio 2015 IDE. In previous version of Visual Studio developers were able to arrange windows as per their need but temporarily. Visual Studio 2015 extends this experience with some productivity enhancements.

Introduction

Window Layout is directly related to the way numerous windows are arranged and laid out in a Visual Studio IDE. IDE (Integrated Development Environment) is every developer’s tool for being creative, develop new things, being logical, fix issues, build and deploy various LOB (Line of Business) solutions etc.

Why Window Layout?

Different developer personality types like the windows to be arrange in specific way. Some like certain windows in the IDE and some like other windows. Some may like Pinned windows and some Tab styled.

Hence, Window Layout enables a developer’s to arrange the windows which they want and how they want and then save the layout for later use. Saved layout can be accessed from any machine on any device and applied to the IDE as long as that layout was saved to your Account Settings via Synchronization. Read Feature#1 Account Management in my previous article

So Window Layout enables you to arrange the IDE in a way you are most comfortable with and provides ease of use and productivity.

Which Windows are those?

Well, today Visual Studio 2015 stands mature and has a lot of windows which may appear in a developer’s screen wrapped into the IDE. For instance:

  1. Solution Explorer
  2. Team Explorer
  3. Server Explorer
  4. SQL Server Object Explorer
  5. Bookmark Window
  6. Call Hierarchy
  7. Class View
  8. Code Definition Window
  9. Object Browser
  10. Error List
  11. Output
  12. Task List
  13. Toolbox
  14. Class view

This list goes on and on, so let’s see the whole list via Visual Studio 2015 View menu.

Figure-1: Visual Studio 2015 View Menu

How to Save a Window Layout

Before you start saving a Window Layout, you to create one. Follow these steps:

1- Arrange windows (all which you work with mostly) in your desired way. For example as shown below:

Figure-2: Arrange windows in Studio 2015

2- Now let’s save this Window Layout. Click on Window menu and choose “Save Window Layout”

Figure-3: Save Window Layout menus option

3- Name the Layout properly so you can recall from the name and click OK.

Figure-4: Naming a Layout

4- Now Layout is Saved and Synchronized with your Account Settings.

Reset Window Layout

Once you have saved the Layout and you want to test it, you have to reset the layout to default layout which Visual Studio IDE brings to you.

Go to Window menus and click on “Reset Window Layout”

Figure-5: Reset Window Layout menus option

Once you click on this option, Visual Studio will prompt you to confirm that you want to restore the default window layout. Click on Yes.

Figure-6: Confirmation dialog to Reset Window Layout

Now, Your IDE will be re-arranged to default layout as shown in the image below. Which could be the one you are having right now in your Visual Studio IDE.

Figure-7: Default layout after Reset of the layout

Applying Saved Window Layout

To apply your saved Window Layout, go to Window menus and click on “Apply Window Layout” and choose one of the previously saved Window Layout. I have created and named my layout as “Pinned_Windows”

Figure-8: Apply Window Layout menu option

Click on “Pinned_Windows” layout and Visual Studio will show a confirmation dialog, click OK

Figure-9: Confirmation to Apply saved Window Layout

Now your layout will change to what you have saved and IDE will appear as shown below.

Figure-10: Saved layout applied

Manage Window Layout

As you can imagine you may end up with creating and cleaning up layout as per your needs. Hence, it become very important to manage the layouts which are created and available in your Account Settings.

You can easily manage the layouts via Window menu and “Manage Window Layout” option

Figure-11: Manage Window Layouts menu option

Once you click on it, a dialog will open and allow you to Rename, Delete etc.

Figure-12: Manage Window Layouts dialog

Summary

Custom Window Layout in Visual Studio 2015 is a brand new way of arranging the windows in the IDE and saving the layout. After saving the layout, it’s also easy to manage and restore the window arrangements. This feature certainly helps the developers to feel comfortable with their window arrangements and continue to be productive across the devices using Visual Studio 2015.

Abstract

Account Management is related to Sign-in feature; which was first time introduced with Visual Studio 2013. This feature has been helpful by various means, but Visual Studio 2015 even extends this experience with some enhancements.

Introduction

Account Management turned out to be very helpful feature, here are some points:

  1. Associate a profile (e.g. web development, C# or general) and synchronize your settings with the development environment once you are logged in to another workstation.
  2. Ability to select graphic themes (Light, Dark, Blue) for appearance of IDE, code and code editor window.
  3. Take direct benefits of MSDN subscription associated with ID, used to Sign In to Visual Studio. For example unlocking Visual Studio or manage licenses associated with Visual Studio.
  4. Automatic login to TFS service account; if subscribed to this. TFS Service is a Microsoft cloud based version of TFS.

Synchronized Settings

Visual Studio 2013 and 2015 allows the users to choose which settings to synchronize. Let’s first understand which Visual Studio settings are candidate for Synchronization.

  • Appearance I.e. Themes, Colors and Fonts.
  • Environment Aliases
  • Keyboard Shortcuts
  • Startup
  • Text Editor

Visual Studio 2013 Synchronized Settings will be as shown in the image below.

Visual Studio 2015 Synchronized Settings will be as shown in the image below.

Account Management

In Visual Studio 2013 and 2015; Account Management comes into the picture as soon as you click on “Sign In” option on the Top-Right of your Visual Studio IDE as shown below.

Or Account Management settings can also be accessed via File –> Account Settings…

Improved Account Management with Visual Studio 2015

Microsoft has improvised Account Management experience for developers and made it better. The core change made in Visual Studio 2015 Account Management is the capability to store multiple accounts and have those listed and stored on that Account Setting page.

Immediate benefit for developers is the ability to log-in to Visual Studio with different associated accounts and work with different set of settings and projects.

Now question is what’s new in this; developers were able to this even with earlier version when it was introduced in Visual Studio 2013. Let’s see by diving deep into Account Settings.

Account Settings – Recap with Visual Studio 2013

When you Sign-in with Visual Studio 2013, your Account Settings page will open asking to Sign In.

After successful Sign-In Account Settings page will appear as follows.

The very obvious issue here is related to developer productivity and a developer who switches between accounts, need to punch-in all different set of credentials repeatedly.

Enhancement to Account Settings in Visual Studio 2015

Visual Studio 2015 comes with an enhanced Account Management feature to enable developers to store multiple Sign-In credentials under Account Settings. Ideally, it would be productive to have multiple accounts registered and then switch easily from one account to another without re-punching all the credentials repeatedly.

Adding New Account

Clicking on “Add an account…” will take you to Sign In dialog as shown below.

After Successful credential validation the Account Settings page will display the newly registered account under All Accounts.

This feature enables developers to have a centralized place to manage accounts and Synchronize settings across every registered Microsoft account.