00-EssentialShortcuts/0.3-ContextualMenus.cs (15 lines of code) (raw):

namespace EssentialShortcuts { // Navigate To menu // // Displays a contextual menu of options you can use to navigate to from // your current location // // Very useful way of navigating without having to learn ALL of the shortcuts! // // <shortcut id="Navigate To…">Alt+` (VS)</shortcut> // // 1. Place text caret on class name, invoke menu // 2. <shortcut id="Show context actions">Alt+Enter</shortcut>on class name, start typing (e.g. "Navigate To", "Extension methods") // // (Most options not useful with this example. Covered in more detail in next section) public class NavigateTo { } // Refactor This menu // // Displays a contextual menu of options for refactoring available at the current location // // Very useful for invoking refactorings without requiring to know ALL shortcuts // // <shortcut id="Refactor This...">Ctrl+Shift+R (VS + IntelliJ)</shortcut> // // 3. Place text caret on class name, invoke menu // Select rename, rename class // 4. <shortcut id="Show context actions">Alt+Enter</shortcut> on class name, start typing (e.g. "Refactor This", "Rename") // // Covered in more detail in next section public class RefactorThis { } // Generate Code menu // // Displays a contextual menu of options for generating code available at the current location // // <shortcut id="Generate...">Alt+Insert (in text editor)</shortcut> // // Covered in more detail in the Editing section public class GenerateCode { } // Inspect This menu // // Displays a contextual menu of options for analysing code and control flow // at the current location // // Very useful for invoking value analysis without learning ALL shortcuts! // // <shortcut id="Inspect This...">Ctrl+Shift+Alt+A (VS + IntelliJ)</shortcut> // // 4. Place text caret on class name, invoke menu // 5. <shortcut id="Show context actions">Alt+Enter</shortcut> on class name, start typing (e.g. "Inspect This", "Hierarchies") // // (Most options not useful with this example. Covered in more detail in later section) public class InspectThis { } }