Overview

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

8.jpg
7.jpg
9.jpg
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.
5.jpg

Click Tab twice

6.jpg

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.
3.jpg

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

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 1:58 PM by sharepointholic, version 13