Posted by Adam Buenz
One of the principal code modifications when using C# 3.0 is the introduction of implicit types. Having freshly concluded a sizeable code review for a manufacturing company where they had just completed framework retrofits, I found myself irritated with the prostitution of implicit types. So I thought that I would attempt [...]
Posted by Adam Buenz
Using SharePoint User Profiles is an exceedingly influential option when working with additional SharePoint user data. One impressive method is the GetPeers() method which as the name implies, allows you to query down into user peers from a profile object. The GetPeers method returns an array of User Profile objects, which you can later iterate [...]
Posted by Adam Buenz
If you consume a SPWebApplication object as a parameter, you can return the virtual directory path by using the GetIisSettingsWithFallback() method to return the settings for a specified SharePoint zone.
Here is a static method that demonstrates how to do it:
Select For Unformatted Code
C#:
public static string GetVirtualDirectoryPath(SPWebApplication webApp)
{
string path = string.Empty;
try
{
if (webApp != null)
{
path = webApp.GetIisSettingsWithFallback(SPUrlZone.Default).Path.ToString();
}
}
catch [...]
Posted by Adam Buenz
One of my friends just asked me a rather distinctive question. What if I wanted to build a typed collection of SPList objects by passing in a SharePoint web (SPWeb) and a pattern to match the list by (string) into some arbitrary method?
In order to do this, we can presume since the pattern is being [...]
Posted by Adam Buenz
It is essential to remember when trying to get the entirety of WebForms within a SPWeb object to make certain that you loop through both the SPWeb.Files to compensate for the root level file collection as well as through each SPList testing its items. Often times you will find when trying to build a “master” [...]
Posted by Adam Buenz
I am a huge fan of developing and employing shared libraries across the enterprise regardless of objective, be it third party WebPart interface components or exclusively containing common method implementation. I really enjoy the fact that code base refinement and adjustment can happen so effortlessly with minimal friction when a common baseline of libraries used [...]
Posted by Adam Buenz
Recently I was working on a SharePoint timer job for some data synchronization across numerous WebParts. In order to do this I had to load through code the pertinent assemblies from the GAC (I know, I know. I should be using the bin for security purposes, but it is a client request to be in [...]