Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut for autocompleting properties in visual studio?

I was watching a video about C# and the guy used a shortcut to implement a property.

public decimal Price { get; set; }

He wouldn't write the whole line, but instead let the visual studio editor fill in the get and set. Does anyone know the shortcut for completing the last part of the line above? Or even better, like a pdf quick-reference overview?

like image 492
Kasper Hansen Avatar asked Apr 11 '11 09:04

Kasper Hansen


1 Answers

In Visual Studio 2010 you can type 'prop' then press tab twice. It's probably the same in earlier versions.

Edit: You'll then have to change the type (defaults to int) and the name (defaults to MyProperty).

Edit2: I've just found this great tool that allows you to edit these code snippets to override their default behaviour, or create new ones: http://snippeteditor.codeplex.com/

like image 91
Jackson Pope Avatar answered Sep 29 '22 04:09

Jackson Pope