Adam Buenz hat 22 Code Snippets aus SharePoint Projekten online gestellt:
This section provides code snippets that show general SharePoint centric code, such as that used in webparts or applications that tap into the object model (22 Snippets)
Access SharePoint User Information - This piece of code shows you how to access the current SharePoint Users information.
Create SharePoint Query - This is a small piece of code that shows you how to create a SharePoint query.
Creating A WebPart Menu Item - This snippet demonstrates a method that will allow you to specify a link in the webpart menu box (the context menu that you get with webparts). It is helpful when creating custom menu items for webparts, although appears to be deprecated in 3.0.
Determine If List Column Exists - This method is helpful if you need to determine whether a column in a list exists or not by passing in the column name as a string value. It is a helpful method when working with SharePoint field existence.
Determine if there are files and folders - This example shows you how to determine whether there are files or folders in a SharePoint asset. This is an asset existence method and can be used to prevent the overriding of other content.
Display A Users Role Collection - This snippet shows you how to display a particular users set of roles based on the user name parameter.
Display Site Collection Information - This method shows you how you can in a webpart display various pieces of information about a SharePoint site collection.
Example XSL Transformation - If you have an XSL document that you wish to apply to you webpart returns, you need a method to apply the XSL transformation.
Get a SharePoint Field By Its Name - This piece of code demonstrates how you could return a SharePoint field by passing in the name parameter.
Get A SharePoint List - This is a simple method that will add you in getting a SharePoint list from a site.
Get A Web Based On List Existence - This code sample demonstrates how to get a specific web based on a SharePoint list, returning the specific web. It also includes several layers of exception handling and various properties that can be set.
Get An XSL Filepath For WebParts - This method allows you to get an XSL File Path that you can use in your webparts. I find it useful if I am applying formatting to things that are generated out of the object model.
Get List View Items - This code sample provides method that will get the list items that are present in a SharePoint view.
Get the WebPart Qualifier - This method gets the webpart qualifier.
Getting A SharePoint Site Name - This piece of code shows you how to retrieve a SharePoint Site name after using the OpenWeb() method.
Insert Values Into The URL - This method will help you when you need to insert parameters into the URL string.
Load Lists Into Drop Down Control - This example shows how you could load all the lists in a web into a drop down control, for use in a toolpane or otherwise.
Open Up A Web Conditionally - This method shows you how you can open up a web conditionally based on pre-existing text, such as whether it exists in a text box in this specific example.
Progamatically Move List - This example shows you how to move a list within an arbitrary number of webs in SharePoint.
Redirect Users To Sites - This code snippet will allow you to redirect users to various sites based on their login.
Return Boolean If Flat Folder Structure - This example shows you how to return a boolean value if there is a flat folder structure present.
Show Whether A SharePoint Field Contains Metainformation - This is a small code sample that will show you how to determine whether a SharePoint field contains meta information.
Technorati tags: Sharepoint 2007, WSS3.0, MOSS 2007, SharePoint, SharePointCommunity, SDK
Bereitgestellt
2 Mai 2007 14:08
von
Michael Greth