您可以在 Silverlight 4.0 中从字节数组加载 XAP
我知道 MEF 目前支持从 URI 下载 XAP 文件(这太棒了!),但是有人知道是否可以让 MEF 从字节数组加载 XAP?
谢谢!
I know that MEF currently supports downloading XAP files from a URI (which is awesome!), but does anyone know if it's possible to have MEF load a XAP from a byte array?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这实际上就是 DeploymentCatalog 所做的。由于 MEF 的源代码是可用的 (mef.codeplex.com),您可以参考它。您要查找的代码位于 src\Composition.Initialization\System\ComponentModel\Composition\Hosting\Package.cs 中。 LoadPackagingAssemblies 获取(XAP 的)流并返回其中的程序集。
Yes, this is in fact what DeploymentCatalog does. And since the source code to MEF is available (mef.codeplex.com), you can just refer to that. The code you are looking for is in src\Composition.Initialization\System\ComponentModel\Composition\Hosting\Package.cs. The LoadPackagedAssemblies takes a stream (of a XAP) and returns the assemblies in it.