Quantcast
Channel: SPCodeSnippets By : Ayman El-Hattab
Viewing all articles
Browse latest Browse all 20

Updated Wiki: Home

$
0
0
Overview

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

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

Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>