silverlight - How do I add a header to a MEF call -
i have silverlight application download xaps using mef. put authorization token in header of call not able reach xaps. this:
catalog = new deploymentcatalog(_uri); catalog.addheader(_header); catalog.downloadasync();
only problem there no addheader method.
deploymentcatalog
uses webclient
under hood, doesn't seem expose in way.
there's copy of source here (couldn't find on codeplex reason). uri used webclient
perform asynchronous download. on completion, response used create collection of assemblies using package.loadpackagedassemblies
. composition performed using assemblies.
some of relevant code:
//the download this.webclient.openreadcompleted += new openreadcompletedeventhandler(handleopenreadcompleted); this.webclient.downloadprogresschanged += new downloadprogresschangedeventhandler(handledownloadprogresschanged); this.webclient.openreadasync(uri, this); //composition on completion of async download var assemblies = package.loadpackagedassemblies(e.result); this.discoverparts(assemblies);
you create custom catalog same thing provides addheader method, or exposes webclient
, or whatever.
Comments
Post a Comment