Thursday, December 31, 2015

Features of Visual Smarter

Visual Smarter provides hundreds of utilities, widgets and tools for helping code more efficiently and manage sources, classes, documents, projects, solutions, registries and so on more conveniently in the Visual Studio IDE, especially within the .NET environment. It makes .NET coding just easier and smarter.

It has 22 Common Utilities.
 Common Utilities

Its total 329 widgets can be categorized into the following 10 groups:

Monday, December 28, 2015

Comment Widgets for Selection

Visual Smarter provides many selection widgets, as shown before. We are going to introduce the comment widgets here.

If there is some code as follows somewhere:

        private void CommentTester()
        {
            int i;
            string hello = "hello world.";
        }

  it's selected, and the Comment widget is called up, the code will become:

//        private void CommentTester()
//        {
//            int i;
//            string hello = "hello world.";
//        }

If the UnComment widget is called up at this moment, the current code will be rolled back to the original.
If the Toggle Comment Type widget were clicked instead, the code would become:

/*        private void CommentTester()
        {
            int i;
            string hello = "hello world.";
        }*/

If the Add Comment to Line End is run against the original code, each line will be appended some comment beginners.

        private void CommentTester() //
        { //
            int i; //
            string hello = "hello world."; //
        } //

Replicate Line Multiple Times & Add Line Number to Line Start Selection Widgets

Visual Smarter provides many selection widgets, as shown before. We are going to introduce the Replicate Line Multiple Times and the Add Line Number to Line Start widgets here.

If there is some code as follows somewhere:

            List<int> intList = new List<int>();
            intList.Add(1);

  the last line is selected, and the Replicate Line Multiple Times widget is called up, a number is input such as 10, then the code will become like this:

            List<int> intList = new List<int>();
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);
            intList.Add(1);

If the ten adding lines are selected and the Add Line Number to Line Start widget is called, the line labels will be added accordingly:

            List<int> intList = new List<int>();
Line_1:             intList.Add(1);
Line_2:             intList.Add(1);
Line_3:             intList.Add(1);
Line_4:             intList.Add(1);
Line_5:             intList.Add(1);
Line_6:             intList.Add(1);
Line_7:             intList.Add(1);
Line_8:             intList.Add(1);
Line_9:             intList.Add(1);
Line_10:             intList.Add(1);

Saturday, December 26, 2015

Visual Smarter Selection Widgets

Visual Smarter provides many selection widgets, as follows:



























They operate on the active selection in the current document, source file.

Friday, December 25, 2015

Visual Smarter Toolbar

The Visual Smarter toolbar looks as follows:





It is a single toolbar at present, but it's composed of two parts actually, Common Utilities and Widgets. We have separated the two sets of toolbar buttons/menus above to make them look both nicer and more meaningful.

Most of these utilities and widgets were mentioned a bit before; some were introduced with descriptions and code or UI examples. More and more will be coming, please stay tuned.

Various Web Searchers & Navigators of Visual Smarter

Visual Smarter provides various Web Searchers and Navigators. Those Web Searchers will open the default web browser and finds the web pages having the keyword as input. Those Web Navigators will navigate to the web pages inside the Visual Studio IDE.

Many search engines and web sites are supported. Here are the list:
  • Google
  • Bing
  • MSDN
  • Yahoo
  • SpiderInNet
  • SpiderInNet1
  • SpiderInNet2
  • VisualSmarter
  • CodeProject
  • NuGet
  • GitHub
  • StackOverflow

Thursday, December 24, 2015

Code Refactors: There Are More

There are more code refactors and they are also self-explanatory. Here they are:
  • CodeLine Replicator
  • IfElseifElse Coder
  • TryCatchFinally Coder

  • Capitalize CurrentLineOfCode
  • Lowercase CurrentLineOfCode
  • UpperCase CurrentLineOfCode

FREE Download and Try Visual Smarter 2015


Wednesday, December 23, 2015

Code Refactors: Insert Various Time Format

Its feature is pretty self-explanatory, inserting a time string with every possible format into the code position of the current cursor.

The various time format looks like the following:



Tuesday, December 22, 2015

Code Refactors: Insert Various Date Format

Its feature is pretty self-explanatory, inserting a date with every possible format into the code position of the current cursor.

The various date format looks like the following:


Code Refactors: Fill GUID into String of Current Code Line

Its feature is pretty self-explanatory, filling a GUID into the string in the current code line.

If something like the following is written somewhere,

string guid = "";

        the cursor is with the quotes, and the Fill GUID into String of Current Line command is called up, the code will look like below:

string guid = "0d00560b-291a-4cac-8b58-186fb0fd11b6";

Many other GUID relevant widgets are provided by Visual Smarter, e.g. listing out GUIDs, replacing existing GUIDs, uniquifying GUIDs, and so on.

FREE Download and Try Visual Smarter 2015

Monday, December 21, 2015

Code Refactors: Rename Privates Fields

Its feature is pretty self-explanatory, renaming class private fields.

If something like the following is written somewhere,

 class CodeTester_Fields { protected int intField; int intFieldWithValue = 123; public readonly int intFieldReadonlyWithValue = 456; public const int intFieldConst = 789; new int intFieldNew; private double doubleFieldWithValue = 123.456; public double doubleField; public static string stringFieldWithValue = "string field with value"; static string stringField; }

        all the fields selected, and the Rename Private Fields command is called up, the following dialog will show up:


If the new naming convention is specified as above and the OK button pressed, the fields will look like below:

 class CodeTester_Fields { protected int intField; int m_IntFieldWithValue = 123; public readonly int intFieldReadonlyWithValue = 456; public const int intFieldConst = 789; new int m_IntFieldNew; private double m_DoubleFieldWithValue = 123.456; public double doubleField; public static string stringFieldWithValue = "string field with value"; static string m_StringField; }

As seen, the command only takes care of private fields, local or static.

FREE Download and Try Visual Smarter 2015

Code Refactors: VB Filed to Property

Its feature is pretty self-explanatory, creating property from VB class field.

If something like the following is written somewhere,

Private time As System.DateTime

        the field is selected, and the VB Field to Property command is called up, the property will be created or adjusted accordingly:

Private m_time As System.DateTime
Public Property time() As System.DateTime Get Return m_time End Get Set(ByVal value As System.DateTime) m_time = value End Set End Property

As can be seen, the field name is prefixed with the m_ so as to avoid conflicts. In case any other field naming convention is necessary, other widgets can help. More will be introduced. Please stay tuned.

FREE Download and Try Visual Smarter 2015


Sunday, December 20, 2015

Code Refactors: Underscore Fields

Its feature is pretty self-explanatory, underscoring class fields.

If something like the following is written somewhere,

class CodeTester_Fields { protected int intField; int intFieldWithValue = 123; public readonly int intFieldReadonlyWithValue = 456; public const int intFieldConst = 789; new int intFieldNew; private double doubleFieldWithValue = 123.456; public double doubleField; public static string stringFieldWithValue = "string field with value"; static string stringField; }

        all the fields selected, and the Underscore Fields command is called up, the class fields will become the following:

class CodeTester_Fields
{
        protected int _intField;
        int _intFieldWithValue = 123;
        public readonly int _intFieldReadonlyWithValue = 456;
        public const int _intFieldConst = 789;
        new int _intFieldNew;

        private double _doubleFieldWithValue = 123.456;
        public double _doubleField;

        public static string _stringFieldWithValue = "string field with value";
        static string _stringField;
}

Enjoy!

FREE Download and Try Visual Smarter 2015

Saturday, December 19, 2015

Visual Smarter 2015 Came Out

Visual Smarter 2015 has been worked out and finally released through hard work.

It is an extension now instead of old style add-in. It still supports multiple Visual Studio editions and versions (2015/2013/2012). Many new utilities and widgets have been added, and all existing ones have been intensively tested, bug fixed, and enhanced a lot.

FREE Download and Try Visual Smarter 2015

Friday, December 18, 2015

Code Refactors: Create Properties From Fields

Its feature is pretty self-explanatory, creating properties from class fields.

If something like the following is written somewhere,

 class CodeTester_Fields_ToProperties { private string name; internal double i; public static int HelloWorld; public DateTime HowAreYouMyFriends; }

        all the four fields selected, and the Create Properties From Fields command is called up, the properties will be created accordingly:

class CodeTester_Fields_ToProperties_After
{
private string _name;

public string name
{
get
{
return _name;
}
set
{
value = _name;
}
}

internal double _i;

public double i
{
get
{
return _i;
}
set
{
value = _i;
}
}

public static int _HelloWorld;

public int HelloWorld
{
get
{
return _HelloWorld;
}
set
{
value = _HelloWorld;
}
}

public DateTime _HowAreYouMyFriends;

public System.DateTime HowAreYouMyFriends
{
get
{
return _HowAreYouMyFriends;
}
set
{
value = _HowAreYouMyFriends;
}
}
}

Enjoy!

Code Refactors: Align C# Auto Properties

Its feature is pretty self-explanatory, aligning C# auto properties.

If something like the following is written somewhere,

class CodeTester_AutoProperties_Before
{
private string name { get; set; }
internal double i { get; set; }
public static int HelloWorld { get; set; }
public DateTime HowAreYouMyFriends { get; set; }
}

        all the four auto properties selected, and the Align C# Auto Properties command is called up, the auto-properties will be aligned nicely like this:








Enjoy!

Wednesday, December 16, 2015

Class Widget: Extract Method From Code Block

Its feature is pretty self-explanatory, extracting a method from some highlighted code block.

If something like the following is written somewhere,

   int busylevel; DayOfWeek day = DateTime.Now.DayOfWeek; switch (day) { case DayOfWeek.Sunday: busylevel = 1; break; case DayOfWeek.Monday: busylevel = 5; break; case DayOfWeek.Tuesday: busylevel = 5; break; case DayOfWeek.Wednesday: busylevel = 4; break; case DayOfWeek.Thursday: busylevel = 4; break; case DayOfWeek.Friday: busylevel = 3; break; case DayOfWeek.Saturday: busylevel = 2; break; default: busylevel = -1; break; }

         the code block selected, and the Extract Method From Code Block command is called up with a method name being given, the following code will be created into the same type where the above code block is:

  public void GetBusyLevel() { int busylevel; DayOfWeek day = DateTime.Now.DayOfWeek; switch (day) { case DayOfWeek.Sunday: busylevel = 1; break; case DayOfWeek.Monday: busylevel = 5; break; case DayOfWeek.Tuesday: busylevel = 5; break; case DayOfWeek.Wednesday: busylevel = 4; break; case DayOfWeek.Thursday: busylevel = 4; break; case DayOfWeek.Friday: busylevel = 3; break; case DayOfWeek.Saturday: busylevel = 2; break; default: busylevel = -1; break; } }

The code compiles right away. Of course, the new method seems better to be tweaked a bit such that its return type is int and the busylevel local var is returned. That needs to be done manually at present. In the future, the widget may become intelligent enough to do so automatically. That is our goal.

Class Widget: Convert Methods to Property


Its feature is pretty self-explanatory, creating properties from methods.

If something like the following is written anywhere in a class,

private string name;

public string GetName()
{
return name;
}
public void SetName(string value)
{
name = value;
}

         the two methods are selected, and the Create Methods From Property command is called up, the following code will be created and maintained:

private string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}

The code compiles right away. Enjoy!

Monday, December 14, 2015

Class Widget: Create Methods From Property

Its feature is pretty self-explanatory, creating method(s) from a property of concern.

If something like the following is written anywhere in a class,

private string name; public string Name { get { return name; } set { name = value; } }

         the cursor is within the property body, and the Create Methods From Property command is called up, the following code will be created and maintained:

private string name;

public string GetName()
{
return name;
}
public void SetName(string value)
{
name = value;
}

The code compiles right away. Isn't it terrific?

Enjoy!

Class Widget: Create Class From Method

Its feature is pretty self-explanatory, creating a class from a method. The new class will be in the same project and within the same namespace, where the type of the method of concern is within. The new class name along with the file name can be specified.

If something like the following is written anywhere in a class,

public bool? IsHelthy(int age, double weight, string type)
{
switch (type)
{
case "cat":
return weight > age * 5;
case "dog":
return weight > age * 10;
default:
return null;
}
}

        the cursor is inside the IsHelthy method, and the Create Class From Method command is called up, and a class/file name is provided properly, e.g. 'Pet', the following class will be created:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CS_Class
{
public class Pet
{
public bool? IsHelthy()
{
switch (type)
{
case "cat":
return weight > age * 5;
case "dog":
return weight > age * 10;
default:
return null;
}
}

private string type;
private double weight;
private int age;
}
}

The namespace of the new class is the same as the type of concern is. In addition, all necessary namespaces are automatically brought in. The code compiles right away. Isn't it terrific?

Enjoy!

FREE Download and Try Visual Smarter 2015

Saturday, December 12, 2015

Class Widget: Create Method from Caller

Its feature is pretty self-explanatory, creating a method into the same class from a highlighted caller. The caller is not a real caller at that moment, of course, since no method definition exists yet for the caller. That is exactly what the Create Method from Caller class widget is supposed to help.

If something like the following is written anywhere in a class,

 int age = 35;   
double salary = 1000000;   
string name = "peter";   
Class1 person = CreatePerson(age, salary, name);

        the cursor is inside the CreatePerson caller, and the Create Method from Caller command is called up, the following method will be created:

 public Class1 CreatePerson(int age, double salary, string name)
 {
   return default(Class1);
 }

The code will be able to compile right away. Isn't it terrific?

Enjoy!

Wednesday, December 9, 2015

Features of DTE Widgets in Visual Smarter

There are many DTE Widgets in Visual Smarter. They are designed to provide information about the DTE environment and components such as command bars, tool windows, and addins.


List Commands: listing out all commands including Visual Studio native ones and custom ones defined within the DTE.
List Keyboard Shortcuts: listing out all the keyboard shortcuts for all commands.
List CommandBars: listing out all the command bars.
List Command Line Arguments: listing out the command line arguments of the Visual Studio startup.
List Invisible Windows: listing out all invisible window names if any.
List Visible Windows: listing out all visible window names.
List Window Configurations: listing out the Visual Studio Window Configutations.
List Context Attributes: listing out the Visual Studio context attributes.
List Addins: listing out all the DTE addins.
List Solution Explorer: listing out the information about the Solution Explorer.
Close All Tool Windows: closing all tool windows.
Run Command: running a DTE command, which can be any from the output of the first command.


FREE Download and Try Visual Smarter 2015

Tuesday, December 8, 2015

Features of Editor Widgets in Visual Smarter

There are many Editor Widgets in Visual Smarter. They are designed to operate on the editor, including all open documents, windows, and the editing environment, of the Visual Studio IDE.


These Editor Widgets of Visual Smarter can be categorized into a few groups. Here they are, along with some brief descriptions for each widget.


Active Document

Back Up Active Document: backing up (creating a .bak file for) the active document in the editor.
Restore Active Document: discarding the changes made to the active document and restoring the backed up content from the .bak file.

Editor Documents/Windows

List Modified Documents: listing out all the modified (dirty) documents in the editor.
Open All Files of Selected Projects: opening all files of the selected projects into the editor environment.
Save & Close All: saving and closing all windows and documents.
Close All Without Saving: discarding all changes in the opened windows and closing all.
Close All With Confirmation: closing all windows with the confirmation to save or not.
Close Design Windows: closing all design windows such as WinForm ones. 
Close Design Windows with Code-Behind Documents: closing all design windows (e.g. form.cs) along with their code-behind documents (e.g. *.design.cs).
Close Documents NOT Associated with Projects: closing those orphan documents, opened from outside instead inside from projects, not associated with any projects in the active solution.
Close Source Documents: closing all source (code) documents such as *.cs and *.vb.
Close Non-Source Documents: closing all non-source documents.
Close Project Setting Windows: closing those project setting windows.

Close All Windows: closing all IDE windows including the editor window itself.

Show/Hide

Show Line Number: showing the line # in the editor.
Hide Line Number: hiding the line # in the editor.
Show All Indicators: showing all indicators such as breakpoint red spots, color bars indicating new code added, line numbers, and similar.
Hide All Indicators: hiding all the above indicators.
Show Navigation Bar: showing the module/class/member navigation bar.
Hide Navigation Bar: hiding the module/class/member navigation bar.
Show Intellisense: showing the intellisense in the editor.
Hide Intellisense: hiding the intellisense in the editor.
Show Virtual Space: showing the virtual space in the editor.
Hide Virtual Space: hiding the virtual space in the editor.

Settings

Turn ON Word Wrap: turning on the word wrap in the code/text editor.
Turn OFF Word Wrap: turning off the word wrap.
Set Indent Style: setting the indent style for the editor.
Set Size of Indent & Tab: setting the size of both indent of tab for the editor.
Turn ON Tabs: turning on tabs.
Turn OFF Tabs: turning off tabs.

FREE Download and Try Visual Smarter 2015

Monday, December 7, 2015

Features of Debugger Widgets in Visual Smarter

There are many Debugger Widgets in Visual Smarter. They are designed to operate on the debugger of the Visual Studio IDE, e.g. attaching processes, setting breakpoints, opening some common testing folders, and so on.. 


These Debugger Widgets of Visual Smarter can be categorized into a few groups. Here they are, along with some brief descriptions for each widget.


Processes

Attach Process: attaching a particular process as specified to the debugger.
Attach IIS Server: attaching the IIS Server process to the debugger.
Attach Remote IIS Server: attaching the Remote IIS Server process to the debugger.
Attach ASP.NET Server: attaching the ASP.NET Server process to the debugger.
Attach Web Server: attaching the Web Server process to the debugger.
Re-attach the Last Process: re-attaching the process that was attached and detached last time.


Breakpoints

Break on All Members of Current Class: breaking on the beginning of All the members of the current class.
Break on All Class Members in the Active Document: breaking on the beginning of All the members of all the classes of the active document. 
Break on All Class Members in the Active Project: breaking on the beginning of All the members of all the classes of the active project.
Break on All Symbol References to Current Type/Member: breaking on all the symbol references to the type or member as highlighted in the editor.
Break on Keyword Search Results in the Active Document: breaking on all the search results in the active document, for the keyword as highlighted.
Break on Keyword Search Results in the Active Project: breaking on all the search results in the active project, for the keyword as highlighted.
Enable All Breakpoints: enabling all break points in the debugger.
Disable All Breakpoints: disabling all break points in the debugger.
Remove All Breakpoints: removing all break points from the debugger.


Folders

Open CommonFiles Folder: opening the CommonFiles folder in an Explorer window.
Open User Local AppData Folder: opening the user local AppData folder in an Explorer window.
Open User Roaming Folder: opening the user Roaming AppData folder in an Explorer window.
Open User Temp Folder: opening the User temp folder in an Explorer window.
Open IE Temp Folder: opening the IE temp folder in an Explorer window.
Open ASP.NET Temp Folder: opening the ASP.NET temp folder in an Explorer window.
Open Recycle BIN: opening the Recycle BIN folder in an Explorer window.


Windows

Show All Debug Windows: showing all available debug windows in the IDE.


Settings

Display Break-On-Exceptions Setting Dialog: displaying the Break On Exceptions setting dialog.

FREE Download and Try Visual Smarter 2015