I’ve had an idea for some time to gather all mine and others nifty extension, utility and helper methods into a shared library so that these can be reused in different projects and I finally got my act together and created a new project on Codeplex called SharePoint Extensions Lib, http://spexlib.codeplex.com/, SPExLib.
This is a library filled with extension methods to the SharePoint object model and to the Microsoft.NET 3.5 SP1 classes as well as some helper classes. All you have to do is reference it in your solution and add the using SPExLib.Extensions statement to your code and you are ready to go.
The goal with this project is to make SharePoint programming easier and to fill in the gaps left out in the standard SharePoint APIs.
This first version contains extension methods such as:
- SPWeb.ListExists() - checks if a list exists in a site
- SPList.ViewExists() - checks if a list contains a specific view
- SPListItem.Contains() - checks if a list item contains a specific field
- SPListItemCollection.FindByField() - returns all items with a certain value to a specific field
- Extensions to the XElement and XmlNode objects
- A set of classes to make creation of WebParts with EditorParts easier to create
- and more
New versions will be released as soon as we have some new and cool extensions.
Contributions - I want you
If you have similar or better implementations that the ones already there, please feel free to show me a better implementation. Let’s make this first class.