Posted by Adam Buenz
This post is also because people said they required a more reusable extension method than here that tapped into SharePoint. Tyrants!
While I was doing a code review that tapped into some of the calendar segments of SharePoint I found this issue come up. When passing date parameters into SPUtility.FormatDate it will expect that it will [...]
Posted by Adam Buenz
Extension methods are a formidable programming construct that augment implementation abstraction and modularize segments of code, lending itself well for filling gaps that may be present in a closed API, such as the one that SharePoint provides. Often times there may be a particular method that is desirable on a particular type, however the options [...]
Posted by Adam Buenz
Auto-Implemented (or just automatic) properties are one of the new features in C# 3.0 that allow property declaration to be additionally succinct, lessening compulsory code thereby lightening maintenance and increasing readability. Auto-properties make SharePoint code, which tends to be property heavy for personalization features much easier to write, (sure, you can use the "prop" code [...]
Posted by Adam Buenz
Often times when building applications that will greatly use SharePoint views for data rotation it is helpful to build CAML builders into separate static classes that return a continuous string representation of the arbitrary query. In order to demonstrate this, consider the following examples BuildDefaultViewQuery, BuildPrivateViewQuery, and BuildPublicViewQuery:
Select For Unformatted Code
C#:
private static string BuildDefaultViewQuery()
{
var builder [...]
Posted by Adam Buenz
For whatever rationale, typed iterations to dump particular SPRecycleBinItem objects out of the SharePoint recycle bin don’t work due to a problem with the proc_DeleteRecycleBinItem stored procedure. But it seems to be indeterminate and I can’t locate any sort of thresholds.
So, for some reason:
Select For Unformatted Code
C#:
public static void NonWorkingRecycleBinDump(string url)
{
using (SPSite site = new [...]
Posted by Adam Buenz
In order to circumvent recoding SharePoint security operations several times over, you might find the below class effective.
Some things to note. There are a lot of literal calls in the code, and it’s on purpose. For instance, instead of passing a specific SPWeb object as a parameter, a string value to represent the URL is [...]
Posted by Adam Buenz
One of the principal problems that demonstrates itself when leveraging the SharePoint content deployment API as a replication tool is at some stage page replication tends to cause page layout corruption, indeterminately. Even more disconcerning, the problem is not resolvable through association using the UI following such a corruptible layout action.
That [...]