SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Rainer Stropek | software architects


Coding Like the Wind
Introduction
• software architects gmbh
• Rainer Stropek
   – Developer, Speaker, Trainer
   – MVP for Windows Azure
   – rainer@timecockpit.com
   –        @rstropek




                                   http://www.timecockpit.com
is the leading time tracking solution for knowledge
workers. Graphical time tracking calendar, automatic tracking of
your work using signal trackers, high level of extensibility and
customizability, full support to work offline, and SaaS deployment
model make it the optimal choice especially in the IT consulting
business.

Try              for free and without any risk. You can get your trial
account at http://www.timecockpit.com. After the trial period you
can use                 for only 0,20€ per user and month without a
minimal subscription time and without a minimal number of users.
ist die führende Projektzeiterfassung für Knowledge
Worker. Grafischer Zeitbuchungskalender, automatische
Tätigkeitsaufzeichnung über Signal Tracker, umfassende
Erweiterbarkeit und Anpassbarkeit, volle Offlinefähigkeit und
einfachste Verwendung durch SaaS machen es zur Optimalen
Lösung auch speziell im IT-Umfeld.

Probieren Sie            kostenlos und ohne Risiko einfach aus.
Einen Testzugang erhalten Sie unter http://www.timecockpit.com.
Danach nutzen Sie              um nur 0,20€ pro Benutzer und
Tag ohne Mindestdauer und ohne Mindestbenutzeranzahl.
Abstract (German)
Richtiger Umgang mit der IDE von Visual Studio
macht einen echten Unterschied in Sachen
Produktivität. In der Session zeigen Ihnen
Roman Schacherl und Rainer Stropek Tipps
und Tricks für Visual Studio C#, die Ihnen
helfen, besser im Code zu navigieren, schneller
Code zu schreiben, Fehler zu finden und vieles
mehr. Die gesamte Session wird bereits mit der
Version 2012 von Visual Studio gemacht.
Intro
• VS 2012 – should I?
   – Development of Windows Store Apps (requires
     Windows 8 also on developer pc)
   – Enhancements are shown in this session – but
     many tips and tricks work in VS 2010)
   – System requirements: Windows 7 or higher
   – Project files are compatible to VS 2010
• Main target: show productivity tips for your
  day-to-day work
NAVIGATE
Call Hierarchy (1/2)
• Shows…
  – …calls from/in selected member
  – …interface implementations
  – …virtual or abstract implementations
• „Find all references (Ctrl+K, R) on
  steroids“
  – Context menu for any member, View Call
    History
  – Ctrl+K, T
Call Hierarchy (1/2)
• Improvements compared to Find all
  references
  – Hierarchical visualization
  – Scope can be specified
  – Deferred execution
  – More proper results (see
    OnPropertyChanged)
• Limitations
  – Use outside of C# Code (e.g. XAML)
Code Definition Window
• View, Code Definition Window
  (Ctrl+W, D)
• Shows the symbol definition based on
  – Sourcecode or
  – Referenced binary Assemblies
• Reacts to
  – Current cursor position
  – Current selection in Class View, Object
    Browser or Call Browser
Quick Launch
• Jump to Quick Launch with Ctrl+Q
• Searches for menus and options
• Specify search scope:
  – @menu … (limit to menu items)
  – @opt … (limit to settings)
  – @mru (Most recently used)
Navigate To (1/3)
• Improved Search
  – IMHO better than Object Browser (Ctrl+W, J)
  – Searching for file names  (e.g. „DBQ“ finds
    „DbClientQuery.cs“)
  – CamelCaseSearch (e.g. „MAN“ finds
    „MarkAsNew“)
• Edit, Navigate To (Ctrl+,)
• Tips
  – Search word in lower case  case insensitive
  – Upper and lower case  case sensitive
  – space = And-conjunction
Navigate To (2/3)
• When is Find better?
  – Quick Find (Ctrl+F) vs. Find In Files
    (Ctrl+Shift+F)
  – Tip: Quick Replace (Ctrl+H) vs. Replace In
    Files (Ctrl+Shift+H)
  – Regular Expressions
• Rarely known, but useful
  – Go to next result in Quick Find (F3)
  – Go to definition (F12) works also without
    having the source code
Navigate To (3/3)
• Tip: F8, to move to the next element in lists (go to next
  location)
   • Build Errors
   • Find Results
   • Etc.
• Tip: Ctrl+Minus, to navigate to the last shown source code
  line (navigate backward)
TODO Lists (1/3)
• // TODO: …
TODO Lists (2/3)
• Bookmarks (Ctrl+B, T)
• Can be named
TODO Lists (3/3)
• Task List Shortcuts (Ctrl+E, T)
Reference Highlighting
• All symbol references are highlighted
   • references = everything found by Find All References
     (Ctrl+K, R)
• Ctrl+Shift+ and Ctrl+Shift+ to jump between
  references
• Can be enabled/disabled in the settings
• Colors can be configured in the settings
Outlining
• Outlining as known
  • Collapse to definitions (Ctrl+M, O)
  • Toggle outlining (Ctrl+M, M)
• Tip: #region Code Snippet
• Tip: Ad Hoc Blocks
  • Select the code block
  • Hide Selection (Ctrl+M, Ctrl+H)
  •  Ad Hoc Block gets created
CODE GENERATION
Generate From Usage
• Useful with TDD
• Accessible via…
  • …Mouse (Smart Tag = Pain)
  • …Ctrl+. (=Pain Killer)
• Generates Type, Field, Property or
  Method
  • Tip: Generate New Type if code should be
    generated in a different project (e.g. test
    projects)
IntelliSense (1/2)
• Modes
   • Completion Mode (as known)
   • Suggestion Mode (for TDD; see Generate From
     Usage)
• Switch completion mode with Ctrl+Alt+Space
• How to get the member list manually?
   • Ctrl+K, L (or Ctrl+J)
IntelliSense (2/2)
• Parameter informations are displayed with
  Ctrl+Shift+Space




• Show Quick Info (Ctrl+K, I)
IntelliSense (2/2)
• Parameter informations are displayed with
  Ctrl+Shift+Space




• Show Quick Info (Ctrl+K, I)
C# Code documentation
• Tooltips
• Sandcastle
  • Sandcastle Help File Builder
  • MAML for concept files
  • GhostDoc
Snippets (1/2)
• Insert prepared code blocks
• Optional
  • Parameter
  • using Statements
  • References
• Code Snippet UI (Ctrl+K, X)
• Code Snippet Manager (Ctrl+K, Ctrl+B)
• Tip: Snippet Designer on Codeplex
Snippets (2/2)
• Surround code block with snippet:
  Ctrl+K, S
Code Snippets in ASP.NET
Item and Project Templates (1/4)
Item and Project
      Templates (2/4)

• Generates a ZIP file containing
  the template
• Has to be deployed manually
• Use VSIX projects to create
  installer
Item and Project Templates (3/4)
Item and Project Templates (4/4)
• Install Visual Studio 2012 SDK for Extensibility project types




• Read more about item/project templates in VS2012:
  http://msdn.microsoft.com/en-us/library/ms247121.aspx
T4 Templates
•   Integrated Template engine in Visual Studio
•   Use e.g. for
     – Code generation
     – Generation of XML or HTML
•   Development Time / Compile Time / Runtime
•   Read more about T4:
    http://msdn.microsoft.com/en-us/library/bb126445.aspx
T4 (Development- and Design Time)
T4 (Runtime)
WINDOWS AND VIEWS
Solution Explorer
       • Search
       • Expand tree down
         to Methods
       • Open multiple
         Solution Explorers
         with different scopes
       • Show Base/Derived
         Types
Test Explorer
• Replaces the
  Test Toolbar
• Demo: Analyze
  test coverage
„New Project“-Dialog

                       Ctrl+E
Fast Add Reference 


                       Ctrl+E
Docking
• Document Windows
  • Docking also in Document Frame
  • Tip: Multi-monitor support
• Tip: Ctrl+Doubleclick on window title to
  get it back to the last position
BTW – Did you know?
• Go to open file (Ctrl+Alt+Down)
• Split Window




• Track Active Item in Solution Explorer (Ctrl+Q, @opt track)
Zoom
• Zoom in text window with
  Ctrl+Mousewheel
• Doesn‘t work in windows with icons
Selection
• Boxed Selection with Alt+Click&Drag



• Multi-Line Insert (also with zero-length
  boxes): Alt+Click&Drag
BTW – Did you know?
DEBUGGING
Conditional Breakpoints
• Breakpoint hits only, if the given
  condition is true
• Be careful: slows down execution!
IntelliTrace
• Record errors in scenarios, where you
  don‘t have Visual Studio – and debug
  them locally afterwards
• Record specific Events during execution
  (e.g. all sent SQL statements and
  exceptions)
• Unfortunately only Ultimate Edition
IntelliTrace
Immediate Window
• Ctrl+D,I
• Execute code during Design Time or
  Debugging
Data Tips (1/2)
• Present in the debugger for variables of current
  scope
   • Pin to source: Data Tip is linked to source code
     position and scrolls with the text
   • Comments on pinned data tips
Data Tips (2/2)
• Pinning Subexpressions


• Tip: Object-IDs
DLR Support
• Specific support of dynamic data type
  in Debugger
Thank you
for your attention.
rainer@timecockpit.com

Weitere ähnliche Inhalte

Andere mochten auch

WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
 
P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#Rainer Stropek
 
Parallel and Async Programming With C#
Parallel and Async Programming With C#Parallel and Async Programming With C#
Parallel and Async Programming With C#Rainer Stropek
 
Business Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes SenseBusiness Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes SenseRainer Stropek
 
Programming With WinRT And Windows8
Programming With WinRT And Windows8Programming With WinRT And Windows8
Programming With WinRT And Windows8Rainer Stropek
 
Michael Kiener Associates Ltd
Michael Kiener Associates LtdMichael Kiener Associates Ltd
Michael Kiener Associates LtdMichaelKiener
 
Telerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJSTelerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJSRainer Stropek
 
Cloud computing was bringt's
Cloud computing   was bringt'sCloud computing   was bringt's
Cloud computing was bringt'sRainer Stropek
 

Andere mochten auch (10)

WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA Austria
 
P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#
 
Parallel and Async Programming With C#
Parallel and Async Programming With C#Parallel and Async Programming With C#
Parallel and Async Programming With C#
 
Business Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes SenseBusiness Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes Sense
 
Programming With WinRT And Windows8
Programming With WinRT And Windows8Programming With WinRT And Windows8
Programming With WinRT And Windows8
 
Vertaalbureau Perfect
Vertaalbureau PerfectVertaalbureau Perfect
Vertaalbureau Perfect
 
Michael Kiener Associates Ltd
Michael Kiener Associates LtdMichael Kiener Associates Ltd
Michael Kiener Associates Ltd
 
Telerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJSTelerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJS
 
Sculptura in coaja de ou
Sculptura in coaja de ouSculptura in coaja de ou
Sculptura in coaja de ou
 
Cloud computing was bringt's
Cloud computing   was bringt'sCloud computing   was bringt's
Cloud computing was bringt's
 

Ähnlich wie Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C# IDE

FIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools WorkshopFIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools WorkshopPaul Filkin
 
The Ring programming language version 1.10 book - Part 7 of 212
The Ring programming language version 1.10 book - Part 7 of 212The Ring programming language version 1.10 book - Part 7 of 212
The Ring programming language version 1.10 book - Part 7 of 212Mahmoud Samir Fayed
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!Alessandro Giorgetti
 
Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux Strongback Consulting
 
TypeScript and SharePoint Framework
TypeScript and SharePoint FrameworkTypeScript and SharePoint Framework
TypeScript and SharePoint FrameworkBob German
 
Engage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino ApplicationsEngage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino Applicationspanagenda
 
Kotlin for android 2019
Kotlin for android 2019Kotlin for android 2019
Kotlin for android 2019Shady Selim
 
Reproducible research concepts and tools
Reproducible research concepts and toolsReproducible research concepts and tools
Reproducible research concepts and toolsC. Tobin Magle
 
DITA on a Shoe String
DITA on a Shoe StringDITA on a Shoe String
DITA on a Shoe StringStan Doherty
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.pptDevliNeeraj
 
Zend Studio Tips and Tricks #zendcon 10
Zend Studio Tips and Tricks #zendcon 10Zend Studio Tips and Tricks #zendcon 10
Zend Studio Tips and Tricks #zendcon 10Roy Ganor
 

Ähnlich wie Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C# IDE (20)

FIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools WorkshopFIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools Workshop
 
VS 2010 codename Rosario
VS 2010 codename RosarioVS 2010 codename Rosario
VS 2010 codename Rosario
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
The Ring programming language version 1.10 book - Part 7 of 212
The Ring programming language version 1.10 book - Part 7 of 212The Ring programming language version 1.10 book - Part 7 of 212
The Ring programming language version 1.10 book - Part 7 of 212
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux Being Smart about C/C++ Development on AIX and Linux
Being Smart about C/C++ Development on AIX and Linux
 
TypeScript and SharePoint Framework
TypeScript and SharePoint FrameworkTypeScript and SharePoint Framework
TypeScript and SharePoint Framework
 
Engage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino ApplicationsEngage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino Applications
 
Kotlin for android 2019
Kotlin for android 2019Kotlin for android 2019
Kotlin for android 2019
 
Reproducible research concepts and tools
Reproducible research concepts and toolsReproducible research concepts and tools
Reproducible research concepts and tools
 
DITA on a Shoe String
DITA on a Shoe StringDITA on a Shoe String
DITA on a Shoe String
 
T4 presentation
T4 presentationT4 presentation
T4 presentation
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
c++ ppt.ppt
c++ ppt.pptc++ ppt.ppt
c++ ppt.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
Reproducible research
Reproducible researchReproducible research
Reproducible research
 
Zend Studio Tips and Tricks #zendcon 10
Zend Studio Tips and Tricks #zendcon 10Zend Studio Tips and Tricks #zendcon 10
Zend Studio Tips and Tricks #zendcon 10
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C# IDE

  • 1. Rainer Stropek | software architects Coding Like the Wind
  • 2. Introduction • software architects gmbh • Rainer Stropek – Developer, Speaker, Trainer – MVP for Windows Azure – rainer@timecockpit.com – @rstropek http://www.timecockpit.com
  • 3. is the leading time tracking solution for knowledge workers. Graphical time tracking calendar, automatic tracking of your work using signal trackers, high level of extensibility and customizability, full support to work offline, and SaaS deployment model make it the optimal choice especially in the IT consulting business. Try for free and without any risk. You can get your trial account at http://www.timecockpit.com. After the trial period you can use for only 0,20€ per user and month without a minimal subscription time and without a minimal number of users.
  • 4. ist die führende Projektzeiterfassung für Knowledge Worker. Grafischer Zeitbuchungskalender, automatische Tätigkeitsaufzeichnung über Signal Tracker, umfassende Erweiterbarkeit und Anpassbarkeit, volle Offlinefähigkeit und einfachste Verwendung durch SaaS machen es zur Optimalen Lösung auch speziell im IT-Umfeld. Probieren Sie kostenlos und ohne Risiko einfach aus. Einen Testzugang erhalten Sie unter http://www.timecockpit.com. Danach nutzen Sie um nur 0,20€ pro Benutzer und Tag ohne Mindestdauer und ohne Mindestbenutzeranzahl.
  • 5. Abstract (German) Richtiger Umgang mit der IDE von Visual Studio macht einen echten Unterschied in Sachen Produktivität. In der Session zeigen Ihnen Roman Schacherl und Rainer Stropek Tipps und Tricks für Visual Studio C#, die Ihnen helfen, besser im Code zu navigieren, schneller Code zu schreiben, Fehler zu finden und vieles mehr. Die gesamte Session wird bereits mit der Version 2012 von Visual Studio gemacht.
  • 6. Intro • VS 2012 – should I? – Development of Windows Store Apps (requires Windows 8 also on developer pc) – Enhancements are shown in this session – but many tips and tricks work in VS 2010) – System requirements: Windows 7 or higher – Project files are compatible to VS 2010 • Main target: show productivity tips for your day-to-day work
  • 8. Call Hierarchy (1/2) • Shows… – …calls from/in selected member – …interface implementations – …virtual or abstract implementations • „Find all references (Ctrl+K, R) on steroids“ – Context menu for any member, View Call History – Ctrl+K, T
  • 9. Call Hierarchy (1/2) • Improvements compared to Find all references – Hierarchical visualization – Scope can be specified – Deferred execution – More proper results (see OnPropertyChanged) • Limitations – Use outside of C# Code (e.g. XAML)
  • 10. Code Definition Window • View, Code Definition Window (Ctrl+W, D) • Shows the symbol definition based on – Sourcecode or – Referenced binary Assemblies • Reacts to – Current cursor position – Current selection in Class View, Object Browser or Call Browser
  • 11. Quick Launch • Jump to Quick Launch with Ctrl+Q • Searches for menus and options • Specify search scope: – @menu … (limit to menu items) – @opt … (limit to settings) – @mru (Most recently used)
  • 12. Navigate To (1/3) • Improved Search – IMHO better than Object Browser (Ctrl+W, J) – Searching for file names  (e.g. „DBQ“ finds „DbClientQuery.cs“) – CamelCaseSearch (e.g. „MAN“ finds „MarkAsNew“) • Edit, Navigate To (Ctrl+,) • Tips – Search word in lower case  case insensitive – Upper and lower case  case sensitive – space = And-conjunction
  • 13. Navigate To (2/3) • When is Find better? – Quick Find (Ctrl+F) vs. Find In Files (Ctrl+Shift+F) – Tip: Quick Replace (Ctrl+H) vs. Replace In Files (Ctrl+Shift+H) – Regular Expressions • Rarely known, but useful – Go to next result in Quick Find (F3) – Go to definition (F12) works also without having the source code
  • 14. Navigate To (3/3) • Tip: F8, to move to the next element in lists (go to next location) • Build Errors • Find Results • Etc. • Tip: Ctrl+Minus, to navigate to the last shown source code line (navigate backward)
  • 15. TODO Lists (1/3) • // TODO: …
  • 16. TODO Lists (2/3) • Bookmarks (Ctrl+B, T) • Can be named
  • 17. TODO Lists (3/3) • Task List Shortcuts (Ctrl+E, T)
  • 18. Reference Highlighting • All symbol references are highlighted • references = everything found by Find All References (Ctrl+K, R) • Ctrl+Shift+ and Ctrl+Shift+ to jump between references • Can be enabled/disabled in the settings • Colors can be configured in the settings
  • 19. Outlining • Outlining as known • Collapse to definitions (Ctrl+M, O) • Toggle outlining (Ctrl+M, M) • Tip: #region Code Snippet • Tip: Ad Hoc Blocks • Select the code block • Hide Selection (Ctrl+M, Ctrl+H) •  Ad Hoc Block gets created
  • 21. Generate From Usage • Useful with TDD • Accessible via… • …Mouse (Smart Tag = Pain) • …Ctrl+. (=Pain Killer) • Generates Type, Field, Property or Method • Tip: Generate New Type if code should be generated in a different project (e.g. test projects)
  • 22. IntelliSense (1/2) • Modes • Completion Mode (as known) • Suggestion Mode (for TDD; see Generate From Usage) • Switch completion mode with Ctrl+Alt+Space • How to get the member list manually? • Ctrl+K, L (or Ctrl+J)
  • 23. IntelliSense (2/2) • Parameter informations are displayed with Ctrl+Shift+Space • Show Quick Info (Ctrl+K, I)
  • 24. IntelliSense (2/2) • Parameter informations are displayed with Ctrl+Shift+Space • Show Quick Info (Ctrl+K, I)
  • 25. C# Code documentation • Tooltips • Sandcastle • Sandcastle Help File Builder • MAML for concept files • GhostDoc
  • 26. Snippets (1/2) • Insert prepared code blocks • Optional • Parameter • using Statements • References • Code Snippet UI (Ctrl+K, X) • Code Snippet Manager (Ctrl+K, Ctrl+B) • Tip: Snippet Designer on Codeplex
  • 27. Snippets (2/2) • Surround code block with snippet: Ctrl+K, S
  • 28. Code Snippets in ASP.NET
  • 29. Item and Project Templates (1/4)
  • 30. Item and Project Templates (2/4) • Generates a ZIP file containing the template • Has to be deployed manually • Use VSIX projects to create installer
  • 31. Item and Project Templates (3/4)
  • 32. Item and Project Templates (4/4) • Install Visual Studio 2012 SDK for Extensibility project types • Read more about item/project templates in VS2012: http://msdn.microsoft.com/en-us/library/ms247121.aspx
  • 33. T4 Templates • Integrated Template engine in Visual Studio • Use e.g. for – Code generation – Generation of XML or HTML • Development Time / Compile Time / Runtime • Read more about T4: http://msdn.microsoft.com/en-us/library/bb126445.aspx
  • 34. T4 (Development- and Design Time)
  • 37. Solution Explorer • Search • Expand tree down to Methods • Open multiple Solution Explorers with different scopes • Show Base/Derived Types
  • 38. Test Explorer • Replaces the Test Toolbar • Demo: Analyze test coverage
  • 40. Fast Add Reference  Ctrl+E
  • 41. Docking • Document Windows • Docking also in Document Frame • Tip: Multi-monitor support • Tip: Ctrl+Doubleclick on window title to get it back to the last position
  • 42. BTW – Did you know? • Go to open file (Ctrl+Alt+Down) • Split Window • Track Active Item in Solution Explorer (Ctrl+Q, @opt track)
  • 43. Zoom • Zoom in text window with Ctrl+Mousewheel • Doesn‘t work in windows with icons
  • 44. Selection • Boxed Selection with Alt+Click&Drag • Multi-Line Insert (also with zero-length boxes): Alt+Click&Drag
  • 45. BTW – Did you know?
  • 47. Conditional Breakpoints • Breakpoint hits only, if the given condition is true • Be careful: slows down execution!
  • 48. IntelliTrace • Record errors in scenarios, where you don‘t have Visual Studio – and debug them locally afterwards • Record specific Events during execution (e.g. all sent SQL statements and exceptions) • Unfortunately only Ultimate Edition
  • 50. Immediate Window • Ctrl+D,I • Execute code during Design Time or Debugging
  • 51. Data Tips (1/2) • Present in the debugger for variables of current scope • Pin to source: Data Tip is linked to source code position and scrolls with the text • Comments on pinned data tips
  • 52. Data Tips (2/2) • Pinning Subexpressions • Tip: Object-IDs
  • 53. DLR Support • Specific support of dynamic data type in Debugger
  • 54. Thank you for your attention. rainer@timecockpit.com