Didn't you find yourself writing SPContext.Current.Site, SPSecurity.RunWithElevatedPrivileges and list.Items.Add() more than hundred times in most of your SharePoint projects ?
So Why Reinvent the wheel ?
SPCodeSnippets provides the most commonly used SharePoint code snippets that follow SharePoint development best practices.
Just integrate them into your visual studio , reuse the code and speed up your SharePoint development.

For more info refer to : http://ayman-elhattab.blogspot.com

How to use SPCodeSnippets

As shown in the snapshots above, you can just right click in visual studio, choose SPCodeSnippets and select the snippet that you need.

Alternatively, some snippets come with Shortcuts as shown in the following snapshot.

Click Tab twice


Other Examples :
spcs --> SPContext.Current.Site;
spcw ---> SPContext.Current.Web;
CurrentUser ---> SPUser currentUser = web.CurrentUser;

How to install SPCodeSnippets ?

1) Extract the rar file.
2) Open Visual Studio 2005.
3) Open the code snippets manager ( Ctrl + K then Ctrl + B ) or from the tools menu.

4) Click Add and point to the folder where you extracted the snippets into.

5) Now you can use SPCodeSnippets .

Notes : The snippets are only for C# projects and tested for Visual Studio 2005 and 2008

Last edited Aug 21, 2009 at 12:58 PM by sharepointholic, version 13