With SharePoint 2010 you can write client Applications based on Microsoft .NET framework and that can access SharePoint Server Content without installing Application on the server that runs SharePoint Server 2010.
The SharePoint client object model lets you write client-side code to work with all the common objects in SharePoint sites.
- Web Parts
- Document Library
Through the object model, you can add and remove lists, add, update, and delete list items, change documents in document libraries, create sites, manage permissions of items, and add and remove Web Parts from a page.
|Sites ||Create, Manage permission|
|Web Parts||Add, Remove Web Parts from a Page.|
SharePoint 2010 Client Object Model consists of two .NET Assembly
How Client Object Model Works
The Following diagram shows the above Client object Model Method calls.
Now i am going to build Sample WPF Application. First we need to add references to two assemblies, Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll. you can find these assemblies on the server and they are located in the following directory %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\ISAPI.
Create New WPF Project and Add SharePoint Client object Model Dll. and Make sure that you set Build option as Platform target to Any CPU
Now we are going to query all the list from http://win-m2ircoq6iqa:44119/ site. add the following controls to above Created WPF Application. ListBox, Button and Text Block.
First Create the ClinetContext object to connect the site in SharePoint Server to work with then you need to select the object you wanted to work with here i am selected SharePoint List and then you execute the Query and get the response.