发明授权
- 专利标题: Architecture that extends types using extension methods
- 专利标题(中): 使用扩展方法扩展类型的体系结构
-
申请号: US11192919申请日: 2005-07-29
-
公开(公告)号: US07685567B2公开(公告)日: 2010-03-23
- 发明人: Henricus Johannes Maria Meijer , Anders Hejlsberg , Matthew J. Warren , Luca Bolognese , Peter A. Hallam , Gary S. Katzenberger , Dinesh C. Kulkarni
- 申请人: Henricus Johannes Maria Meijer , Anders Hejlsberg , Matthew J. Warren , Luca Bolognese , Peter A. Hallam , Gary S. Katzenberger , Dinesh C. Kulkarni
- 申请人地址: US WA Redmond
- 专利权人: Microsoft Corporation
- 当前专利权人: Microsoft Corporation
- 当前专利权人地址: US WA Redmond
- 代理机构: Workman Nydegger
- 主分类号: G06F9/44
- IPC分类号: G06F9/44
摘要:
Architecture that extends existing types including constructed and sealed types using extension methods. Extension methods are static methods that can be invoked using instance method syntax. Extension methods are declared by specifying the keyword “this” as a modifier on the first parameter of the methods. Extension methods have all the capabilities of regular static methods. In addition, once imported, extension methods can be invoked using instance method syntax. Also disclosed are rules for importing extension methods, and extension method invocations. Extension methods are imported through using-namespace-directives. In addition to importing the types contained in a namespace, a using-namespace-directive imports all extension methods in all static classes in the namespace. In effect, imported extension methods appear as additional methods on the types that are given by their first parameter and have lower precedence than regular instance methods.
公开/授权文献
- US20070028209A1 Architecture that extends types using extension methods 公开/授权日:2007-02-01
信息查询