getting the most from xamarin studio - michael hutchinson

43
Getting the Most from Xamarin Studio Michael Hutchinson Soware Engineer Xamarin [email protected]

Upload: xamarin

Post on 02-Nov-2014

6.360 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Getting the Most from Xamarin Studio - Michael Hutchinson

Getting the Most from Xamarin Studio

Michael Hutchinson So!ware Engineer Xamarin [email protected]

Page 2: Getting the Most from Xamarin Studio - Michael Hutchinson

Customizing the Workspace

Page 3: Getting the Most from Xamarin Studio - Michael Hutchinson

Your Workspace

Document Solution Pad

Global Search Configuration/Target

Selectors Notification Area

Auto-hidden Pads

Page 4: Getting the Most from Xamarin Studio - Michael Hutchinson

Key Bindings • Do common things more quickly

•  See them in menus and global search

•  Find them and rebind them in Preferences

•  Preferences è General è Key Bindings

•  Access many hidden commands!

Page 5: Getting the Most from Xamarin Studio - Michael Hutchinson

Editor Behavior •  Preferences è Text Editor

•  Enable code folding, auto-formatter

•  Enable markers and visual guides

•  Change word breaking mode

•  Even vi emulation!

Page 6: Getting the Most from Xamarin Studio - Michael Hutchinson

Build Behavior •  Preferences è Projects è Build

•  Jump to errors, warnings, or neither

• Message bubbles or error pad

•  Save files before build, ask or ignore

• Whether to build before running

Page 7: Getting the Most from Xamarin Studio - Michael Hutchinson

Policies •  Solution-specific style settings: formatting, naming

conventions, file header, etc.

•  Edit in Solution Options

• User Preferences only apply to new solutions

• Manage policies in Custom Policies dialog

Page 8: Getting the Most from Xamarin Studio - Michael Hutchinson

DEMO

Page 9: Getting the Most from Xamarin Studio - Michael Hutchinson
Page 10: Getting the Most from Xamarin Studio - Michael Hutchinson

Getting Around Quickly

Page 11: Getting the Most from Xamarin Studio - Michael Hutchinson

Global Search •  Activate with ⌘. on Mac, Ctrl-, on Windows

• Navigate to files, types, members, commands

•  Smart camelCase search

•  Type filter prefixes – file:, class:, command:

•  Location suffix – :line,column

Page 12: Getting the Most from Xamarin Studio - Michael Hutchinson

Find and Replace •  Inline search– click magnifying glass for options

•  Find in Files – search/replace in project/solution Cmd-Shi!-F (Mac), Ctrl-Shi!-F (Windows)

•  Pin search output pads to keep results – next search will use new pad

Page 13: Getting the Most from Xamarin Studio - Michael Hutchinson

Navigation • Go To Declaration – go directly to type, local, member

Cmd-D (Mac), F12 (Windows)

•  Find References – find all places anything is used Cmd-Shi!-R (Mac), Shi!-F12 (Windows)

• Navigate back to where you were Ctrl-Cmd-Le! (Mac), Ctrl-Alt-Le! (Windows)

Page 14: Getting the Most from Xamarin Studio - Michael Hutchinson

DEMO

Page 15: Getting the Most from Xamarin Studio - Michael Hutchinson
Page 16: Getting the Most from Xamarin Studio - Michael Hutchinson

Efficient Editing

Page 17: Getting the Most from Xamarin Studio - Michael Hutchinson

Code Completion • Use camelCase to search

•  Import type, add the using automatically: Ctrl-Alt-Space

•  Toggle suggestion mode, explicit commit: Ctrl-Shi!-Space

Page 18: Getting the Most from Xamarin Studio - Michael Hutchinson

Hidden Editor Commands

•  Expand selection: Alt-Shi!-Up

• Move line up/down: Alt-Up/Down

•  Block selection – edit many columns at once Alt (Mac), Ctrl (Windows) and mouse drag

Page 19: Getting the Most from Xamarin Studio - Michael Hutchinson

Context Actions •  Contextual code transformations

• Over 70 available, see Preferences è�

Source Code è C# è Context Actions

•  Access via context menu è Refactor

•  From keyboard, Alt-Enter

Page 20: Getting the Most from Xamarin Studio - Michael Hutchinson

Source Analysis

•  Analyses source code on the fly

• Warns of potential errors and style violations

• Offers automatic fixes as context actions

• Hints when context actions available

•  Customizable severity of rules

•  Preferences è Text Editor è Source Analysis

Experimental

Page 21: Getting the Most from Xamarin Studio - Michael Hutchinson

DEMO

Page 22: Getting the Most from Xamarin Studio - Michael Hutchinson
Page 23: Getting the Most from Xamarin Studio - Michael Hutchinson

Advanced Debugging

Page 24: Getting the Most from Xamarin Studio - Michael Hutchinson

Debugger Options •  Preferences è Projects è Debugger

•  Enable stepping into framework code

•  Speed up debugging by disabling automatic ToString() and property evaluation

Page 25: Getting the Most from Xamarin Studio - Michael Hutchinson

Advanced Breakpoints •  Tracepoints – print expression and resume

•  Conditional breakpoints – automatically resume unless expression evaluates to true

•  Run è New [Function] Breakpoint…

•  Context menu è Breakpoint Properties

Page 26: Getting the Most from Xamarin Studio - Michael Hutchinson

Watches • Watch any expression, not just variables

•  Turn hover inspection into pinned watch on editor surface by clicking pin icon

• Watches/locals turn blue when value changes

Page 27: Getting the Most from Xamarin Studio - Michael Hutchinson

DEMO

Page 28: Getting the Most from Xamarin Studio - Michael Hutchinson
Page 29: Getting the Most from Xamarin Studio - Michael Hutchinson

Adding Features with Add-ins

Page 30: Getting the Most from Xamarin Studio - Michael Hutchinson

Creating Add-ins

• Whole IDE built on add-in model, extremely extensible

•  Commands, templates, build, syntax schemes, context actions, pads, editors, analysis rules, project types…

• Most of the IDE is open-source (MonoDevelop)

•  Publish at http://addins.monodevelop.com, install from Add-in Manager

Page 31: Getting the Most from Xamarin Studio - Michael Hutchinson

DEMO

Page 32: Getting the Most from Xamarin Studio - Michael Hutchinson
Page 33: Getting the Most from Xamarin Studio - Michael Hutchinson

Resources • My blog

http://mhut.ch

•  Xamarin Studio Forums http://forums.xamarin.com/categories/xamarin-studio

•  Stack Overflow http://stackoverflow.com/questions/tagged/xamarin-studio

• MonoDevelop Developer Resources http://monodevelop.com/Developers

Page 34: Getting the Most from Xamarin Studio - Michael Hutchinson

Q&A

Page 35: Getting the Most from Xamarin Studio - Michael Hutchinson

THANK YOU

Page 36: Getting the Most from Xamarin Studio - Michael Hutchinson

Navigation Commands

Command Mac Windows

Go to Definition Cmd-D F12

Find References Cmd-Shi!-R Shi!-F12 Navigate Forward/Back Ctrl-Cmd-Le!/Right Ctrl-Alt-Le!/Right Next/Previous Result Cmd-Opt-Up/Down F4 / Shi!-F4 Find in Files Cmd-Shi!-F Ctrl-Shi!-F

Find Cmd-F Ctrl-F

Next/Previous Usage Cmd-Shi!-Up/Down Ctrl-Shi!-Up/Down

Page 37: Getting the Most from Xamarin Studio - Michael Hutchinson

Hidden Editor Commands

Command Mac Windows

Expand selection Alt-Shi!-Up

Insert line below Shi!-Enter

Dynamic abbrev Ctrl-/ Alt-/

Delete to end of line Ctrl-K

Move line up/down Alt-Up/Down

Subword motion Ctrl-Le!/Right Alt-Le!/Right

Block selection Alt-Mouse-Drag Ctrl-Mouse-Drag

Page 38: Getting the Most from Xamarin Studio - Michael Hutchinson

Debugger Commands

Command Mac Windows

Start/Resume Cmd-Enter F5

Pause Cmd-Opt-P Ctrl-Break

Toggle Breakpoint Cmd-\ F9

Step Over Cmd-Shi!-O F10

Step Into Cmd-Shi!-I F11

Step Out Cmd-Shi!-U Shi!-F11

Page 39: Getting the Most from Xamarin Studio - Michael Hutchinson

THANK YOU

Page 40: Getting the Most from Xamarin Studio - Michael Hutchinson

Code Generation Window •  Contextual generation of members/statements

• Depends on context

•  Edit è Show Code Generation Window

•  Alt-Insert on Windows

Page 41: Getting the Most from Xamarin Studio - Michael Hutchinson

Catchpoints •  Pause at the point an exception is thrown, even

if it’s handled

•  Run è Exceptions, add exception types to the list

•  Breaks on all subtypes

Page 42: Getting the Most from Xamarin Studio - Michael Hutchinson

Code Templates •  Code snippets with smart linked regions

•  Edit è Insert Template/Surround With...

• Or type short name, Tab twice

•  Create and edit in Preferences è Text Editor è Code Templates

Page 43: Getting the Most from Xamarin Studio - Michael Hutchinson

Inspect Threads and Stack Frames • Double-click thread in threads pad to show stack

• Double-click stack frame to show location

•  External code frames show in italic

•  Editor highlights current stack frame in yellow and other frames in green