SharePoint 2010 Development with Silverlight (Gal Zentner's Library) by Bob German & Paul Stubbs

SharePoint 2010 Development with Silverlight (Gal Zentner's Library) by Bob German & Paul Stubbs

Author:Bob German & Paul Stubbs
Language: eng
Format: epub
Publisher: Addison-Wesley Professional
Published: 2012-06-14T16:00:00+00:00


* * *

private Action action;

public LoadClientOM(Action action)

{

this.action = action;

WebClient client = new WebClient();

client.OpenReadCompleted += ReadCompleted;

client.OpenReadAsync

(new Uri("/_layouts/clientbin/Microsoft.SharePoint.Client.xap",

UriKind.Relative));

}

* * *

The second step is to extract the Client OM assemblies from the Microsoft.SharePoint.Client.xap package you downloaded and load the assemblies. Loading the assemblies makes them available to the rest of your application. For each assembly you want to load from the downloaded .xap package, you extract the assembly as a stream using the GetResourceStream method. When you have the stream, you can pass the stream to the Load() method of an AssemblyPart class. And then finally you can callback on the Action delegate to tell the calling application that the assemblies have been loaded and are ready to be used. This is shown in Listing 8.24.

Listing 8.24. Dynamically Loading the Client OM, Part 2



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.