SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Microsoft Visual Studio 2012|Code Tips
Usman ur Rehman Ahmed
Audience Marketing Manager (AMM), Microsoft Pakistan
Code Pointers
NAMED
REGIONS
DRAG & DROP
CODE
INTELLISENSE CTRL + SPACE
QUICK LAUNCH
Ctrl + Q
PREVIEW
TAB
SEARCH AND
SYNC
CODE CLONE
ANALYSIS
AUTO –
IMPLEMENTED
PROPERTIES
GO TO
DEFINITION
CODE
MAP
SURROUND
WITH
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
ALT +
HIGHLIGHT
COMMENT
CODE BLOCK
USE PHYSICAL
KEYBOARD ON
EMULATOR
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
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
Menus
@menu
Most Recently
Used
@mru
Options
@opt
Open
Document
@doc
Solution Explorer -> Preview Selected Items
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
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
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
Highlight text vertically
ALT +
HIGHLIGHT
Comment Chunks of Code
–COMMENT:
• Ctrl + KC
–UNCOMMENT:
• Ctrl + KU
–/// <summary>
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();
Visual studio2012 tipsandtricks

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (9)

What is new in J2SE 5
What is new in J2SE 5What is new in J2SE 5
What is new in J2SE 5
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming Language
 
Flow or Type - how to React to that?
Flow or Type - how to React to that?Flow or Type - how to React to that?
Flow or Type - how to React to that?
 
Clean code: meaningful Name
Clean code: meaningful NameClean code: meaningful Name
Clean code: meaningful Name
 
Standards For Java Coding
Standards For Java CodingStandards For Java Coding
Standards For Java Coding
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
 
Common Programming Paradigms
Common Programming ParadigmsCommon Programming Paradigms
Common Programming Paradigms
 
XKE - Programming Paradigms & Constructs
XKE - Programming Paradigms & ConstructsXKE - Programming Paradigms & Constructs
XKE - Programming Paradigms & Constructs
 
Algorithms&flowcharts
Algorithms&flowchartsAlgorithms&flowcharts
Algorithms&flowcharts
 

Andere mochten auch

UI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flowUI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flowTung Nguyen Thanh
 
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.iotviet
 
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]leduyk11
 
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...MasterCode.vn
 
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theoBài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theoMasterCode.vn
 

Andere mochten auch (7)

UI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flowUI prototyping with ms expression blend sketch flow
UI prototyping with ms expression blend sketch flow
 
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
 
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
Lập trình c# 2008 cơ bản (nhất nghệ) [thủ thuật it 360]
 
Tài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise Viettinsoft
Tài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise ViettinsoftTài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise Viettinsoft
Tài liệu hướng dẫn phần mềm quản lý chấm công Att_Paradise Viettinsoft
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
Bài 4: Lập trình với CSDL ADO.NET & Kiến trúc không kết nối & Lập trình giao ...
 
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theoBài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
Bài 1: Làm quen với ASP.NET - Giáo trình FPT - Có ví dụ kèm theo
 

Ähnlich wie Visual studio2012 tipsandtricks

Writing Good Code
Writing Good CodeWriting Good Code
Writing Good CodeLeo Liang
 
Advanced Debugging in XCode
Advanced Debugging in XCodeAdvanced Debugging in XCode
Advanced Debugging in XCodeMichelBueno10
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perlmegakott
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptxStefan Oprea
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)Concentrated Technology
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
Clean code - DSC DYPCOE
Clean code - DSC DYPCOEClean code - DSC DYPCOE
Clean code - DSC DYPCOEPatil Shreyas
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - RefactoringDiaa Al-Salehi
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Codeerikmsp
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principlesdeonpmeyer
 
SF1 - Apex Development Best Practises
SF1 - Apex Development Best PractisesSF1 - Apex Development Best Practises
SF1 - Apex Development Best PractisesSebastian Wagner
 
Principled And Clean Coding
Principled And Clean CodingPrincipled And Clean Coding
Principled And Clean CodingMetin Ogurlu
 
Programming in Java: Getting Started
Programming in Java: Getting StartedProgramming in Java: Getting Started
Programming in Java: Getting StartedMartin Chapman
 
Writing maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL codeWriting maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL codeDonald Bales
 

Ähnlich wie Visual studio2012 tipsandtricks (20)

Writing Good Code
Writing Good CodeWriting Good Code
Writing Good Code
 
Code quality
Code qualityCode quality
Code quality
 
Advanced Debugging in XCode
Advanced Debugging in XCodeAdvanced Debugging in XCode
Advanced Debugging in XCode
 
Code Quality
Code QualityCode Quality
Code Quality
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
L05 Design Patterns
L05 Design PatternsL05 Design Patterns
L05 Design Patterns
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptx
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Clean code - DSC DYPCOE
Clean code - DSC DYPCOEClean code - DSC DYPCOE
Clean code - DSC DYPCOE
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - Refactoring
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Ma3696 Lecture 3
Ma3696 Lecture 3Ma3696 Lecture 3
Ma3696 Lecture 3
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
SF1 - Apex Development Best Practises
SF1 - Apex Development Best PractisesSF1 - Apex Development Best Practises
SF1 - Apex Development Best Practises
 
Principled And Clean Coding
Principled And Clean CodingPrincipled And Clean Coding
Principled And Clean Coding
 
Programming in Java: Getting Started
Programming in Java: Getting StartedProgramming in Java: Getting Started
Programming in Java: Getting Started
 
Writing maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL codeWriting maintainable Oracle PL/SQL code
Writing maintainable Oracle PL/SQL code
 

Mehr von Tung Nguyen Thanh

How to become senior .net developer
How to become senior .net developerHow to become senior .net developer
How to become senior .net developerTung Nguyen Thanh
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design IntroductionTung Nguyen Thanh
 
Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Tung Nguyen Thanh
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationTung Nguyen Thanh
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabaseTung Nguyen Thanh
 
HaNoi Net Group Introduction
HaNoi Net Group IntroductionHaNoi Net Group Introduction
HaNoi Net Group IntroductionTung Nguyen Thanh
 
Software architecture for high traffic website
Software architecture for high traffic websiteSoftware architecture for high traffic website
Software architecture for high traffic websiteTung Nguyen Thanh
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentTung Nguyen Thanh
 
Visual studio 2015 ide new features
Visual studio 2015 ide new featuresVisual studio 2015 ide new features
Visual studio 2015 ide new featuresTung Nguyen Thanh
 
How to release every week case study of continuous integration
How to release every week case study of continuous integrationHow to release every week case study of continuous integration
How to release every week case study of continuous integrationTung Nguyen Thanh
 
Workshop fight legacy code write unit test
Workshop fight legacy code write unit testWorkshop fight legacy code write unit test
Workshop fight legacy code write unit testTung Nguyen Thanh
 
Developing windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightDeveloping windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightTung Nguyen Thanh
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTung Nguyen Thanh
 

Mehr von Tung Nguyen Thanh (20)

How to become senior .net developer
How to become senior .net developerHow to become senior .net developer
How to become senior .net developer
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6
 
Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
 
HaNoi Net Group Introduction
HaNoi Net Group IntroductionHaNoi Net Group Introduction
HaNoi Net Group Introduction
 
Software architecture for high traffic website
Software architecture for high traffic websiteSoftware architecture for high traffic website
Software architecture for high traffic website
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Refactoring code in .net
Refactoring code in .netRefactoring code in .net
Refactoring code in .net
 
Visual studio 2015 ide new features
Visual studio 2015 ide new featuresVisual studio 2015 ide new features
Visual studio 2015 ide new features
 
Whatmakesoftwareflexible
WhatmakesoftwareflexibleWhatmakesoftwareflexible
Whatmakesoftwareflexible
 
How to release every week case study of continuous integration
How to release every week case study of continuous integrationHow to release every week case study of continuous integration
How to release every week case study of continuous integration
 
Xp not windows xp
Xp not windows xpXp not windows xp
Xp not windows xp
 
Is xp still extreme
Is xp still extremeIs xp still extreme
Is xp still extreme
 
Workshop fight legacy code write unit test
Workshop fight legacy code write unit testWorkshop fight legacy code write unit test
Workshop fight legacy code write unit test
 
Windows Phone Introduction
Windows Phone IntroductionWindows Phone Introduction
Windows Phone Introduction
 
Developing windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightDeveloping windows phone 7 application with silverlight
Developing windows phone 7 application with silverlight
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and Answers
 

Kürzlich hochgeladen

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Visual studio2012 tipsandtricks

  • 1. Microsoft Visual Studio 2012|Code Tips Usman ur Rehman Ahmed Audience Marketing Manager (AMM), Microsoft Pakistan
  • 2. Code Pointers NAMED REGIONS DRAG & DROP CODE INTELLISENSE CTRL + SPACE QUICK LAUNCH Ctrl + Q PREVIEW TAB SEARCH AND SYNC CODE CLONE ANALYSIS AUTO – IMPLEMENTED PROPERTIES GO TO DEFINITION CODE MAP SURROUND WITH
  • 3. 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 ALT + HIGHLIGHT COMMENT CODE BLOCK USE PHYSICAL KEYBOARD ON EMULATOR Equals(object); GetHashCode(); GetType(); ToString();
  • 4. # 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
  • 5. 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
  • 6. Select a code block (highlight it) Drag and Drop to Toolbox (recommended: rename)
  • 7. 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
  • 8. CTRL + SPACE Display IntelliSense
  • 9. QUICK LAUNCH Ctrl + Q Ctrl + Q Menus @menu Most Recently Used @mru Options @opt Open Document @doc
  • 10. Solution Explorer -> Preview Selected Items PREVIEW TAB
  • 11. Solutions Explorer -> Search & Sync – Enter keyword to Search for results within the project SEARCH AND SYNC – Sync Solutions Explorer to the currently active tab
  • 12.
  • 13.
  • 14. 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
  • 15. Double Click a Clone Entry
  • 16. Code Clones in Entire Solution – "Analyze solution for Code Clones" is only available in Ultimate and Premium editions of Visual Studio 2012
  • 17. 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
  • 18. PROP / PROPFULL – prop • public string Name{get; set;} – propfull • private string _Name; public string Name { get { return _Name; } set { _Name=value; } } AUTO – IMPLEMENTED PROPERTIES
  • 20. Seeing is Believing – Visualize Code – Point and click your way through complex code hierarchy CODE MAP
  • 22. 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
  • 23. Tools -> Options -> Text Editor -> All Languages -> Line Numbers DISPLAY NUMER OF LINES
  • 24. 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
  • 25. Ctrl + g – Specify the line number – You will be jumped to that line automatically GO TO SPECIFIC LINE NUMBER
  • 26. Pascal Case Methods – Type initials of every pascal case methods – E.g. BookAnotherFlight will be accessible by BAF PASCAL CASE TYPING
  • 27. Noun-Verb Convention – Use verbs or verb cases to name methods – Verbs describe the action – Use Pascal Case • RemoveAll() • GetCharArray() • GroupedItem() METHOD NAMING
  • 28. Invoke Multiple Method Calls – Core concept behind it is to allow for better readability – Reduces the amount of code METHOD CHAINING
  • 29. Offline Help Content – Help -> – Set Help Preferences -> – Launch in Help Viewer – Help -> View Help OFFLINE HELP
  • 30.
  • 32. Comment Chunks of Code –COMMENT: • Ctrl + KC –UNCOMMENT: • Ctrl + KU –/// <summary> COMMENT CODE BLOCK
  • 33. Page up / page down Key USE PHYSICAL KEYBOARD ON EMULATOR
  • 34. 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();

Hinweis der Redaktion

  1. The green highlighting shows the last items that were added to the map. The green arrow shows your cursor’s position in the code. Arrows between items represent different relationships. You can get more info about items on the map by examining their tooltips.the Visual Studio suite of products utilizes an XML language called Directed Graph Markup Language (DGML) to describe and define graphs. DGML is used to generate Code Maps in Visual Studio 2012.