Silverlight中枚举并加载客户端程序集
生活随笔
收集整理的這篇文章主要介紹了
Silverlight中枚举并加载客户端程序集
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
參考如下代碼實(shí)現(xiàn):
private static Type GetTypeFromAnyLoadedAssembly(string typeName) {Type type = null;foreach (AssemblyPart part in Deployment.Current.Parts) {StreamResourceInfo resourceStream = Application.GetResourceStream(new Uri(part.Source, UriKind.Relative));if (resourceStream != null) {Assembly assembly = new AssemblyPart().Load(resourceStream.Stream);if (assembly != null) {type = Type.GetType(typeName + "," + assembly, false);}}if (type != null) {return type;}}return type; }總結(jié)
以上是生活随笔為你收集整理的Silverlight中枚举并加载客户端程序集的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 陈丕宏:公司领导人对企业文化的影响
- 下一篇: PVST负载均衡