Invention Application
- Patent Title: Architecture that extends types using extension methods
- Patent Title (中): 使用扩展方法扩展类型的体系结构
-
Application No.: US11192919Application Date: 2005-07-29
-
Publication No.: US20070028209A1Publication Date: 2007-02-01
- Inventor: Henricus Meijer , Anders Hejlsberg , Matthew Warren , Luca Bolognese , Peter Hallam , Gary Katzenberger , Dinesh Kulkarni
- Applicant: Henricus Meijer , Anders Hejlsberg , Matthew Warren , Luca Bolognese , Peter Hallam , Gary Katzenberger , Dinesh Kulkarni
- Applicant Address: US WA Redmond 98052
- Assignee: Microsoft Corporation
- Current Assignee: Microsoft Corporation
- Current Assignee Address: US WA Redmond 98052
- Main IPC: G06F9/44
- IPC: G06F9/44 ; G06F9/45

Abstract:
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.
Public/Granted literature
- US07685567B2 Architecture that extends types using extension methods Public/Granted day:2010-03-23
Information query