Category Archives: Visual Studio

Tool for coding patterns into Visual Studio.

Coding patterns change over the years and most common are Pascal Case and Camel Case.
What is this patterns? The simple way: PascalCase means the first char should be capitalized, while camelCase means the first char should be lowercased.
Example:

This tool is a simple visual studio extension and can help you to deal with this type of patterns.
It converts a selected text between snake_case, camelCase and PascalCase.
About snake case (or snake_case) this patterns is the practice of writing compound words or phrases in which the elements are separated with one underscore character (_) and no spaces.
Download it and start install this tool with douoble click.
Under Visual Studio you can use from menu file I.D.E. EditAdvancesConvert Case or use the keys:
Ctrl + Shift + K or Ctrl + Shift + C.
The keys not worked with Visual Studio 2017 just from menu.
Another problem with this tool: you need to select just the word to make change.
If you want to change word cases and order the conversion pattern, set this option from ToolsOptionsCase Converter.
If you select a block of source code the entire source text will be changed.However, it’s the only tool I’ve ever found to solve this problem.
I’ve never worked with visual studio extension. I do not know the security issues that can arise when implementing such a tool in your I.D.E.

Posted in All, Visual Studio, Windows 10. Tagged with , , , , , , .

Using C # and Visual Studio 2015 to make additional form.

Today I will told you about how to use additional form into C# source code without using Form Design.
First you need to open under Visual Studio 2015 a new project Windows Form Application.
This project will come with a windows form.
Press Ctr+Alt+X keys and will see the Toolbox with all Windows controls.
Add one button to your window form with double left click.
Use double left click to your button and will see the source code of your form.
The C# script will be Form1.cs and for your button will have this:

If you want to open a new form with your button then you need to add source code:

This source code will make a new form named fInfo with this text: Info and about !.
Into this form will have a label named myText with this text: This software is created by the website: free-tutorials.org!.
The form fInfo add the label myText and finally show this form.
The source code come with size, height , weight and location to show the form and label to design form.
The StartPosition is used to put the form into center of your screen.

Posted in All, C#, Programming, Visual Studio, Windows 10. Tagged with , , , , , , .

Using C# with twilio to send SMS – part 001.

You need to have a account at twilio.com.
I used a free trial account to make this demo application.
You need to take for you a number on that support Twilio SMS. I got one in the US to send SMS to my country.
Open your Visual Studio and create a new Project with Windows Form Application.
This will make your Windows Form with Form1.cs and Form1.cs [Design] .
You need to install with Visual Studio the twilio-csharp library.
This library lets you write C# code – go to Visual Studio menu:
Tools > NuGet Package Manager > Package Manager Console and use this command to install twilio-csharp library.

Find the Toolbox ( Ctrl+Alt+X keys ) and add one button to your Windows Form.
Under Form1.cs [Design] press double left click with the mouse on Button ( is named button1 ).
This will open the Form1.cs and add this source code:

Fill with your accountSid, authToken and your number mobile phone from your twilio account console.
Save the file Form1.cs and then Build and Run the application.
Press the button to send the SMS message and you will see this output:

Posted in All, C#, Programming, Visual Studio, Windows 10. Tagged with , , , , .

Programming with C# and Unity 3D game engine – part 003 .

In this tutorials I will show how to deal with lists and enumerations.
First you need to make one C# script under Unity 3D. If don’t know how to do it then read this tutorial.
The list is an object which holds variables in a specific order.
The enumeration is an object with one distinct type that consists of a set of named constants called the enumerator list.
Let’s start with lists.
You need to put this on your script:

Now you can create list under your class , see the example with one class named YourClass:

We can see the List’s syntax is at first confusing. If you take a look to types – int, sting and GameObject and variables – ages, names and objects then the base remain this: List<...> … = new List<...>(); where types are into <> and variables can be created with = new … ().
Now will add one value to names with:

To reverse one list in-place then use this:

If you want then can remove one:

We can use an array to initialize a List named animals:

Loop into the list animals and print the list:

To get the number of elements from animals list, use this:

To clean the list just use this:

The next step is enumerations and is define by the enum type.
An enum type internally contains an enumerator list like this example:

In this enum named animals, cat will be zero (unless given another value explicitly), dog will be one, and fox will be two …
To print out the enum values, you can call ToString on the enum variable in a program.
The Console.WriteLine can automatically call the ToString method.
Using GetValues method with foreach to returns an array that contains a value for each member of the enumType enumeration.

Sometimes we have a string value that we want to convert to an equivalent enum and we can use Parse().
Also you can used many enum like: Enum.Parse, Enum.TryParse, Enum.Format, Enum.IsDefined…
You can get values from enum , see the example:

Convert enums to list:

Posted in C#, Game engine, Unity 3D, Visual Studio, Windows 10. Tagged with , , , , , , .

How to see and understanding the shaders with Microsoft Visual Studio.

You need Visual Studio from Microsoft from Visual Studio 2015 website .
The shaders used by Microsoft Visual Studio 2015 come like DGSL file.
This extension is associated with the Microsoft Visual Studio integrated development environment that allows programmers to create applications for Microsoft Windows, Windows Phone, web etc.
Also , the .dgsl file stores definitions of 3D surfaces.
Any of the dgsl file type can be found here: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\VsGraphics\Assets\Effects\;
You can see one screenshot of visual one shaders.shaders

Posted in All, Visual Studio, Windows 10. Tagged with , , , .