Microsoft Visual Studio 2012 | Code Tips Usman ur Rehman Ahmed Audience Marketing Manager (AMM), Microsoft Pakistan.

Slides:



Advertisements
Similar presentations
Microsoft Office XP Microsoft Excel
Advertisements

Chapter 1: An Introduction to Visual Basic 2012
Microsoft Expression Web-Illustrated Unit L: Using Code Tools.
1 ADVANCED MICROSOFT POWERPOINT Lesson 5 – Using Advanced Text Features Microsoft Office 2003: Advanced.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
C# Programming: From Problem Analysis to Program Design1 Creating Your Own Classes C# Programming: From Problem Analysis to Program Design 3rd Edition.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
CPIT 102 CHAPTER 2 USING INTERMEDIATE FORMATTING TECHNIQUES.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Word Tutorial 3 Creating a Multiple-Page Report
Visual Studio Tips and Tricks. Credits Zain Naboulsi Microsoft Developer Evangelist isbn:
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
© 2002 ComputerPREP, Inc. All rights reserved. Word 2000: Working with Long Documents.
Chapter 4 Code Editor Goals and Objectives Program more efficiently? How can you speed up your development process? Do you want to learn useful shortcuts.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Neal Stublen Class Objectives  Develop an understanding of the.NET Framework  Gain proficiency using Visual Studio  Begin learning.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Instructional Guide. How does EasyBib make research easier? Citation Generation Easily create a bibliography Export to Word or Google Docs fully formatted.
2. Introduction to the Visual Studio.NET IDE. Chapter Outline Overview of the Visual Studio.NET IDE Overview of the Visual Studio.NET IDE Menu Bar and.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
Word Lesson 2 Basic Editing
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Presented by Dr. Jack E. Johnson at the 2007 NBEA Annual Convention Thursday, April 5, GDP, Distance Learning, & Word 2007 “Perfect Partners in.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
1. Chapter 4 Customizing Paragraphs 3 More Paragraph Changes Highlight a paragraph in Word by applying borders and shading. Sort paragraphs to control.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2007 Lab 2 Revising and Refining a Document.
1 CA203 Presentation Application Working with Outlines Lecture # 3 By Tariq Ibn Aziz Dammam Community college.
Introduction to Excel Editing Your Workbook.
Microsoft Word. Basic Word features New Document Open Save As Right Click on File name  Rename  Delete  Send to Recycle Bin  Restore.
Computer Information Technology – Section 4-1 Some text and examples used with permission from:
Chapter Eleven Classes and Objects Programming with Microsoft Visual Basic th Edition.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 2 Modifying a Table and Creating.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Editing Basics Lesson 8. Skills Matrix SKILL #MATRIX SKILL 2.2.1Cut, copy, and paste text 2.2.2Find and replace text 4.1.1Insert building blocks in documents.
Word Lesson 2 Basic Editing
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Pasewark & Pasewark 1 Word Lesson 2 Basic Editing Microsoft Office 2007: Introductory.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
C# Programming: From Problem Analysis to Program Design1 Creating Your Own Classes C# Programming: From Problem Analysis to Program Design 4th Edition.
1 Word Lesson 2 Basic Editing Microsoft Office 2010 Introductory Pasewark & Pasewark.
Dive Into® Visual Basic 2010 Express
Chapter 2: The Visual Studio .NET Development Environment
Creating Your Own Classes
Chapter 1: An Introduction to Visual Basic 2015
C# Programming: From Problem Analysis to Program Design
5.1 Being Objects and A Glimpse into Coding
VISUAL BASIC.
NORMA Lab. 2 Revision: Unary and Binary Fact Types Ternary Fact Types
Benchmark Series Microsoft Word 2016 Level 2
Chapter 4.
Presentation transcript:

Microsoft Visual Studio 2012 | Code Tips Usman ur Rehman Ahmed Audience Marketing Manager (AMM), Microsoft Pakistan

Code Pointers NAMED REGIONS NAMED REGIONS DRAG & DROP CODE INTELLISENSE CTRL + SPACE QUICK LAUNCH Ctrl + Q PREVIEW TAB PREVIEW TAB SEARCH AND SYNC CODE CLONE ANALYSIS AUTO – IMPLEMENTED PROPERTIES GO TO DEFINITION CODE MAP CODE MAP SURROUND WITH

LINES OF CODE LINES OF CODE DISPLAY NUMER OF LINES ALL IN ONE CODE FRAMEWORK GO TO SPECIFIC LINE NUMBER PASCAL CASE TYPING METHOD NAMING METHOD CHAINING OFFLINE HELP OFFLINE HELP ALT + HIGHLIGHT COMMENT CODE BLOCK USE PHYSICAL KEYBOARD ON EMULATOR Equals(object); GetHashCode(); GetType(); ToString(); Equals(object); GetHashCode(); GetType(); ToString();

# region # endregion – lets you specify a block of code that you can expand or collapse – #region name – name is the name you want to give to the region – The region block must be terminated with a #endregion directive NAMED REGIONS NAMED REGIONS

Paste Code Blocks in Toolbox – You can reuse the code without having to type over and over again – Place it in a toolbox under one of the sections or create your own one – Drag and drop as required – It will now be available in all your projects DRAG & DROP CODE

Select a code block (highlight it) Drag and Drop to Toolbox (recommended: rename)

Ctrl Key – IntelliSense provides an array of options that make language references easily accessible. – Auto - suggestions – Hold down the Ctrl key to see through the code hidden behind the IntelliSense INTELLISENSE

CTRL + SPACE Display IntelliSense

QUICK LAUNCH Ctrl + Q Ctrl + Q Most Recently Open

Solution Explorer -> Preview Selected Items PREVIEW TAB PREVIEW TAB

Solutions Explorer -> Search & Sync – Enter keyword to Search for results within the project SEARCH AND SYNC – Sync Solutions Explorer to the currently active tab

Similar fragments of code – Separate fragments of code that are very similar – Find clones and refactor them – Find clones of a specific fragment or find all clones in your solution CODE CLONE ANALYSIS

Double Click a Clone Entry

Code Clones in Entire Solution – "Analyze solution for Code Clones" is only available in Ultimate and Premium editions of Visual Studio 2012

What is Found? Renamed Identifiers Insert and delete statements added Rearranged statements What is Not Found? Type declarations are not compared Analyze Solution for Code Clones will not find clones that are less than 10 statements long. However, you can apply Find matching clones in solution to shorter fragments InitializeComponent methods

PROP / PROPFULL – prop public string Name{get; set;} – propfull private string _Name; public string Name { get { return _Name; } set { _Name=value; } } AUTO – IMPLEMENTED PROPERTIES

GO TO DEFINITION

Seeing is Believing – Visualize Code – Point and click your way through complex code hierarchy CODE MAP CODE MAP

Ctrl + K,S SURROUND WITH

One Job for One Method – There should be only one job for one method – Ideally, seven to thirty lines of code in one method LINES OF CODE LINES OF CODE

Tools -> Options -> Text Editor -> All Languages -> Line Numbers DISPLAY NUMER OF LINES

Group related code together – Code related to one instance should be together – E.g. properties related to one TextBlock should be together ALL IN ONE CODE FRAMEWORK

Ctrl + g – Specify the line number – You will be jumped to that line automatically GO TO SPECIFIC LINE NUMBER

Pascal Case Methods – Type initials of every pascal case methods – E.g. BookAnotherFlight will be accessible by BAF PASCAL CASE TYPING

Noun-Verb Convention – Use verbs or verb cases to name methods – Verbs describe the action – Use Pascal Case RemoveAll() GetCharArray() GroupedItem() METHOD NAMING

Invoke Multiple Method Calls – Core concept behind it is to allow for better readability – Reduces the amount of code METHOD CHAINING

Offline Help Content – Help -> – Set Help Preferences -> – Launch in Help Viewer – Help -> View Help OFFLINE HELP OFFLINE HELP

Highlight text vertically ALT + HIGHLIGHT

Comment Chunks of Code – COMMENT: Ctrl + KC – UNCOMMENT: Ctrl + KU – /// COMMENT CODE BLOCK

Page up / page down Key USE PHYSICAL KEYBOARD ON EMULATOR

OBJECT Class – Ultimate base class of all classes, all classes derived from it (parent class of every other class) – Inheritance not required to be declared as it is implicit. – FOUR methods of OBJECT class available by default in a class’s object Equals(Object) – Determines whether the specified object is equal to the current object. GetHashCode() – Generates a number corresponding to the value of the object to support the use of a hash table. GetType() – Gets the Type of the current instance. ToString() – Returns a string that represents the current object. Equals(object); GetHashCode(); GetType(); ToString(); Equals(object); GetHashCode(); GetType(); ToString();