




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、李智桦MSDN资深讲师K2 SourceCode2属性(Attributes)属性 是被指定给某一宣告的 Metadata 信息,随后再运用Reflection的方式读回来使用。 例: 串行化Serializable 字段检核Display(Name = “身分证号/统一编号“) 辅助说明Help(item=“chap1” 甚至FrameworkImport、Export 、Compose3运用属性 http:/ Programming Guide)提供功能强大的方法,将宣告信息与 C#代码(类型、方法、属性等)相关联。二种属性:CLR 的定义属性: Defined in the common
2、 language runtime . 例: System.Serializable publicclass SampleClass 客制化属性: 以宣告的方式对程序加入额外的信息,以便稍后运用程序读取出来.例: AttributeUsage(AttributeTargets.All) publicclass HelpAttribute:System.Attribute 4程序设计: 如何使用属性在 C#中宣告属性非常简单 , 它使用继承自System.Attribute 的类别宣告形式并且已经标记着AttributeUsage 属性,如下所示: 5AgendaIntroductionWhat
3、 is MEF?What problems does MEF solve?How does MEF work?Architecture OverviewSamplesQ&A6What is MEF?A very specialInversion of Control Container is an approach in software development that favorsremoving sealed dependencies between classes in order to make code more simple and flexible.Moved the
4、control over theEngine creation outside of theCar and into the code that creates it. This is called.78 Inversion of Control By:控制反转(缩写为 IoC) ,也叫做依赖注入Dependency Injection简称DI。 目的在: 削减计算机程序的耦合问题。为Java著名的框架Spring 的核心 。9What is MEF?TheManaged Extensibility Framework (MEF) simplifies the creation of. MEF
5、 offersdiscovery andcomposition capabilities that you can leverage toload application extensions.10What is?(Part II) TheManaged Extensibility Framework isa new library in .NET ( System.ComponentModel.Composition )thatenables greater reuse of applicationsand components. Using MEF, .NETapplications ca
6、n make the shift from beingstatically compiled to dynamicallycomposed. If you are building extensibleapplications, extensible frameworks andapplication extensions, 11What problems does MEF solve?MEF provides a standard way for the host application to expose itself and consume external extensions. ME
7、F offers a set of discovery approaches for your application to locate and load available extensions.MEF allows tagging extensions with additonal metadata which facilitates rich querying and filtering12How does MEF work?MEFs core is comprised of a and a.A catalog is responsible for discovering extens
8、ions and the container coordinates creation and satisfies dependencies.MEFs first-class citizen is aComposablePart. A composable part offers up one or moreExports, and may also depend on one or more externally provided services orImports.Exports and imports each have aContract.MEFs container interac
9、ts withCatalogs to have access to composable parts.13 MEF diagram14Architecture Overview MEFs design can be divided into three distinct layers:*, which is most of the public API is available to the user;*, which provides a layer of indirection so MEF wont be tight coupled with a single approach to p
10、art discovery, imports/exports definitions and so forth; and finally our default implementation of the primitive layer that we call, which relies on types and attributes for discovery and definition of imports/exports.15三十六计胜战计 一瞒天过海 二围魏救赵 三借刀杀人 四以逸待劳 五趁火打劫 六声东击西敌战计 七无中生有 八暗渡陈仓 九隔岸观火 十笑里藏刀 十一李代桃僵 十二
11、顺手牵羊攻战计 十三打草惊蛇 十四借尸还魂 十五调虎离山 十六欲擒故纵 十七抛砖引玉十八擒贼擒王混战计 十九釜底抽薪 二十浑水摸鱼 廿一金蝉脱壳 廿二关门捉贼 廿三远交近攻 廿四假道伐虢并战计 廿五偷梁换柱 廿六指桑骂槐 廿七假痴不癫 廿八上屋抽梯 廿九树上开花 三十反客为主败战计 卅一美人计 卅二空城计 卅三反间计 卅四苦肉计 卅五连环计 卅六走为上计16设计模式(Design Pattern)这个术语是在1990年代,由Erich Gamma等人,从建筑设计领域引入到计算器科学里去的。是对软件设计中普遍存在(反复出现)的各种问题,所提出的解决方案。设计模式并不直接用来完成程序代码的编写,而
12、是描述在各种不同情况下,要怎么解决问题的一种方案。17Managed Extensibility Framework Explorer Version 0.4.3555.17540Copyright (c) 2009 Microsoft Corporation. All rights reserved. Built for:System.ComponentModel.Composition,Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089 Usage:mefx.exe assembly files and dir
13、ectories action options Example: mefx.exe /file:MyAssembly.dll /causes /verbose Switches: /? Print usage. /causes List root causes - parts with errors not related to the rejection of other parts. /dir:C:MyAppParts Specify directories to search for parts. /exporters:MyContract List exporters of the g
14、iven contract. /exports Find exported contracts. /file:MyParts.dll Specify assemblies to search for parts. /importers:MyContract List importers of the given contract. /imports Find imported contracts. /parts List all parts found in the source assemblies. /rejected List all rejected parts. /type:MyNa
15、mespace.MyType Print details of the given part type. /verbose Print verbose information on each part. /whitelist:RejectionWhitelist.txt Specify parts that may be validly rejected; requres the /rejected or /causes commands.18反射在计算器科学中,反射是指一种特定类型的计算器程序能够在运行时以一种依赖于它的代码的抽象特性和它的运行时(runtime)行为的方式被更改的特性。用比
16、喻来说,这种程序能够观察并且修改自己的行为。In computer science,Reflection is the process by whicha computer program canobserve andmodifyits ownstructure andbehavior.1920 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be inte
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年度新能源发电设备采购合同模板
- 精装开间出租合同范本
- 2025年度财务培训与教育服务合同规范
- 2025年度绿色建筑材料研发贷款合同
- 2025年新型叉车租赁及维护一体化服务合同
- 2025年金字牌仿金箔项目投资可行性研究分析报告
- 2025年小螺丝项目投资可行性研究分析报告
- 2五下作文我的叔叔
- 2025年车载免提安全后视镜项目投资可行性研究分析报告
- 2025年帽架行业深度研究分析报告
- 高中转学申请书
- 2025年中国建材集团所属中建材联合投资有限公司招聘笔试参考题库附带答案详解
- 2025年企业合伙联营框架协议模板(2篇)
- 中国电信行业人工智能行业市场调研及投资规划建议报告
- 2025年苏州工业园区服务外包职业学院高职单招职业技能测试近5年常考版参考题库含答案解析
- 水幕喷淋系统的工作原理与应用
- 门楼施工方案
- 2024年山东海洋集团有限公司社会招聘考试真题
- 小学生拗九节课件
- 《感冒中医治疗》课件
- 研发费用管理制度内容
评论
0/150
提交评论