Handy Visual Studio Code Snippets
- Clone this repository
- In Visual Studio go to Tools --> Code Snippets Manager --> Import
- Navigate to the snippet you want to install and select it (or can select multiple)
- Start using your new snippet by typing the shortcut (see below) and hitting tab twice.
Description: Check an argument for a null value and throw an exception if neccessary
Shortcut: arg
Throws: ArgumentNullException
Description: Check if a string argument is null or empty and throw an exception if it is
Shortcut: sarg
Throws: ArgumentNullException
Description: Check if a guid argument is Guid.Empty and throw an exception if it is
Shortcut: garg
Throws: ArgumentNullException
Description: Check if an argument is null and throw an exception if it is otherwise set the value of a property
Shortcut: set
Throws: ArgumentNullException
Description: Create a method constructor with one argument
Shortcut: ctor1
Description: Create a method constructor with two arguments
Shortcut: ctor2
Description: Create a method constructor with three arguments
Shortcut: ctor3
Description: Create a method constructor with four arguments
Shortcut: ctor4
Description: Create a method constructor with 1 argument that is then passed to the base class Shortcut: base