上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页
摘要: http://msdn.microsoft.com/zh-cn/magazine/ee291628.aspx大多数都是同接口实现 MEF 的。适用 “导出类” 的情况还是比较少的。public interface ISalesOrderView{}[Export(typeof(ISalesOrderView))]public partial class SalesOrderView : UserControl, ISalesOrderView{ ...}[Export]public class ViewFactory{ [Import] ISalesOrderView OrderView{ g 阅读全文
posted @ 2012-06-21 23:33 Ken-Cai 阅读(156) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/zh-cn/magazine/ee291628.aspx*注意 这里是“属性导出”要跟前面的文章(2) “属性导入”对比看。public class Loggerpart{ [Export] public ILog Logger { get { return LogManager.GetLogger("Logger"); }//LogManager.GetLogger是“非MEF程序”,通过属性封装成 MEF 程序了。 }}属性导出在其功能方面如同瑞士军刀,使 MEF 可与其他对象配合良好。您会发现,在将 MEF 集成到现 阅读全文
posted @ 2012-06-21 23:27 Ken-Cai 阅读(223) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/zh-cn/magazine/ee291628.aspx启动 MEF 涉及以下几个步骤:添加需要容器创建的约定的导入。创建 MEF 用于发现部件的目录。创建组合部件实例的容器。通过对容器调用 Composeparts 方法并传入具有导入的实例,来进行组合。DirectoryCatalog catalog = new DirectoryCatalog(".");CompositionContainer container = new CompositionContainer(catalog);container.Compos 阅读全文
posted @ 2012-06-21 23:14 Ken-Cai 阅读(186) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/zh-cn/magazine/ee291628.aspx导入有2种方式: (1)通过属性和字段导入public class ViewFactory{ [Import] public SalesOrderView OrderView { get; set; }}(2)通过构造函数导入public class ViewFactory{[ImportingConstructor] public ViewFactory(SalesOrderView salesOrderView) { }}通过构造函数进行导入(通常称为构造函数注入),使用导入... 阅读全文
posted @ 2012-06-21 23:01 Ken-Cai 阅读(420) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/zh-cn/magazine/ee291628.aspx导出类: 使用者不需要写实例化代码. [Export]public partial class SalesOrderView : UserControl{ public SalesOrderView() { InitializeComponent(); }} 阅读全文
posted @ 2012-06-21 22:59 Ken-Cai 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 在 .NET 4 中使用托管可扩展性框架构建可组合的应用程序 1. 基本概念可组合的部件、导出、 导入、约定、 组合2. MEF 特性化编程模型 这里的"特性", 也称为"属性". 如 [Export] [Import]等. "特性化编程模型" 只是 MEF 支持的众多可能的编程模型之一。MEF 的核心 API 完全与特性无关 阅读全文
posted @ 2012-06-21 22:45 Ken-Cai 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 可能的原因:1. Web 没有引用 Wcf.Web项目.2. Web 的配置文件少了 connectionstring 阅读全文
posted @ 2012-06-21 11:27 Ken-Cai 阅读(212) 评论(0) 推荐(0) 编辑
摘要: CollectionViewSource 好像没有删除的操作. ObservableCollection类既实现了INotifyPropertyChanged接口,又实现了INotifyCollectionChanged接口。使用ObservableCollection类不但可以实现Add、Remove、Clear和Insert操作,还可以触发PropertyChanged事件。虽然上述的ObservableCollection很好用而且继承了INotifyPropertyChanged接口,有些时候我们需要对集合进行排序、过滤、分页等操作,这个时候就需要用ICollectionView接口, 阅读全文
posted @ 2012-06-18 10:08 Ken-Cai 阅读(300) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/webabcd/archive/2010/10/21/1857199.html 阅读全文
posted @ 2012-06-18 08:19 Ken-Cai 阅读(120) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/zh-cn/library/cc903947(v=vs.95) 阅读全文
posted @ 2012-06-18 08:13 Ken-Cai 阅读(170) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页