Show Menu
Cheatography

Visual Studio Express 2013 Step by Step Cheat Sheet (DRAFT) by

Visual Studio Express 2013 Step by Step Summary

This is a draft cheat sheet. It is a work in progress and is not finished yet.

H1 Quick Reference

Create a new console applic­ation using Visual Studio 2013
On the File menu, point to New, and then click Project to open the New Project dialog box. In the left pane, under Installed Templates, click Visual C#. In the middle pane, click Console Applic­ation. in the Location box, specify a directory for the project files. Type a name for the project and then click OK.
Create a new Windows Store blank graphical applic­ation for Windows 8.1 using Visual Studio 2013
On the File menu, point to New, and then click Project to open the New Project dialog box. In the left pane, in the Installed Templates section, expand Visual C#, and then click Windows Store. In the middle pane, click Blank App (XAML). In the Location box, specify a directory for the project files. Type a name for the project and then click OK.
Create a new WPF graphical applic­ation for Windows 7 or Windows 8 using Visual Studio 2013
On the File menu, point to New, and then click Project to open the New Project dialog box. In the left pane, in the Installed Templates section, expand Visual C#, and then click Windows. In the middle pane, click WPF Applic­ation. Specify a directory for the project files in the Location box. Type a name for the project and then click OK.
Build the applic­ation
On the Build menu, click Build Solution.
Run the applic­ation in Debug mode
On the Debug menu, click Start Debugging.
Run the applic­ation without debugging
On the Debug menu, click Start Without Debugging.

H2 Quick Reference

Declare a variable
Write the name of the data type, followed by the name of the variable, followed by a semicolon.
 For example: int outcome;
Declare a variable and give it an initial value
Write the name of the date type, followed by the name of the variable, followed by the assignment operator and the initial value. Finish with a semicolon.
For example: int outcome = 99;
Change the value of a variable
Write the name of the variable on the left, followed by the assignment operator, followed by the expression calcul­ating the new value, followed by a semicolon.
For example: outcome = 42;
Generate a string repres­ent­ation of the value in a variable
Call the ToString method of the variable.
For example: int intVar = 42; string stringVar = intVar.To­Str­ing();
Convert a string to an int
Call the System.In­t32.Parse method.
For example: string stringVar = "­42"; int intVar = System.In­t32.Pa­rse­(st­rin­gVar);
Override the precedence of an operator
Use parent­heses in the expression to force the order of evalua­tion.
For example: (3 + 4) * 5
Assign the same value to several variables
Use an assignment statement that lists all the variables.
For example: myInt4 = myInt3 = myInt2 = myInt = 10;
Increment or decrement a variable
Use the ++ or -- operator. For example: count++;

Index

statement
a command that performs an action.
syntax
well-d­efind set of rules, describing format and constr­uction
semantics
specif­ication of what things do
identifier
a name to identify an element
variable
a storage location to hold a value
oparator
operate on operands (values) to create new values
operands
the values on wich an operator performs its function
NaN
Not a Number
precedence
govern's the order in wich an expres­sion's operators are evaluated.
associ­ativity
the direction in wich the operands of an operator are evaluated.
method
a named sequence of statements

Keywords

reserved keywords
catch false namespace short ushort char finally new sizeof using checked fixed null stackalloc virtual class float object static void const for operator string volatile continue foreach out struct while decimal goto override switch default if params this delegate implicit private throw
not to be used keywords
add get remove alias global select ascending group set async into value await join var descending let where dynamic orderby yield from partial

Naming conven­tions

Important
C# is case-s­ens­itive !
identi­fiers
only letters (upper and lowerc­ase), digits and unders­core. Must start with letter or underscore
variables
Use camelcase (as camelC­ase). don't start with unders­core. Don't differ only by case. Never use Hungarian notation.

Primitive Data Types

H3 Quick Reference

Declare a method
Write the method within a class. Specify the method name, parameter list, and return type, followed by the body of the method between braces. For example: int addVal­ues(int leftHa­ndSide, int rightH­and­Side) { ... }
Return a value from within a method
Write a return statement within the method. For example: return leftHa­ndSide + rightH­and­Side;
Return from a method before the end of the method
Write a return statement within the method. For example: return;
Call a method
Write the name of the method together with any arguments between parent­heses. For example: addVal­ues(39, 3);
Use the Generate Method Stub Wizard
Right-­click a call to the method and then, on the shortcut menu, click Generate Method Stub.
Display the Debug toolbar
On the View menu, point to Toolbars, and then click Debug.
Step into a method
On the Debug toolbar, click Step Into. or On the Debug menu, click Step Into.
Step out of a method
On the Debug toolbar, click Step Out. or On the Debug menu, click Step Out.
Specify an optional parameter to a method
Provide a default value for the parameter in the method declar­ation. For example: void optMet­hod(int first, double second = 0.0, string third = “Hello”) { ... }
Pass a method argument as a named parameter
Specify the name of the parameter in the method call. For example: optMet­hod­(first : 100, third : “World”);
mixed positional and named arguments
First specify all positional arguments, then named arguments.