Quick Add allows you to add code elements more quickly.
Current features (only for C# projects)
- Public "Get" readonly field properties (with constructor) - Public "Get, Private Set" auto-implemented properties - Public "Get, Set" auto-implemented properties
Tutorial 1 : Adding an "EvilGenius" class with 3 Public "Get, Set" auto-implemented properties (from solution explorer)
The extension creates and opens the "EvilGenius.cs" file with the entered information :
Tutorial 2 : Adding an "EvilGenius" class with 3 Public "Get" readonly field properties (from code)
(the name of the class is already filled)
The extension creates "EvilGenius.cs" file with the entered information (same level in project as Class1), but stays on the "Class1.cs" file. You can continue to code as below : The "EvilGenius.cs" file added behind the scenes :
Recommended shortcut Actually, no shortcut is defined for adding class with properties from code. However, you can set one from "Tools", "Options", "Environment", "Keyboard" by searching the "Addnewclasswithproperties" command. I recommend "Ctrl+Shift+/" for QWERTY keyboards and "Ctrl+Shift+!" for AZERTY ones. With the shortcut assigned, you don't have to select text anymore, just fire the command after having typed the name of the class (the extension will find the class name by reading backwards until a space is found)
Possible future features
Reference for the example Developer productivity: What's new in C# 6 Video from Microsoft Virtual Academy (Bill Wagner with Anthony Green) |