Architecture that extends types using extension methods
    5.
    发明授权
    Architecture that extends types using extension methods 有权
    使用扩展方法扩展类型的体系结构

    公开(公告)号:US08370801B2

    公开(公告)日:2013-02-05

    申请号:US12728939

    申请日:2010-03-22

    IPC分类号: G06F9/44

    CPC分类号: G06F8/315

    摘要: 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.

    摘要翻译: 使用扩展方法扩展现有类型(包括构造和密封类型)的体系结构。 扩展方法是可以使用实例方法语法调用的静态方法。 通过将关键字this指定为方法的第一个参数的修饰符来声明扩展方法。 扩展方法具有常规静态方法的所有功能。 另外,一旦导入,可以使用实例方法语法来调用扩展方法。 还公开了导入扩展方法和扩展方法调用的规则。 扩展方法通过using-namespace-directives导入。 除了导入命名空间中包含的类型之外,using-namespace-directive会在命名空间中的所有静态类中导入所有扩展方法。 实际上,导入的扩展方法在其第一个参数给出的类型上显示为附加方法,并且具有比常规实例方法更低的优先级。

    Anonymous types for statically typed queries
    8.
    发明授权
    Anonymous types for statically typed queries 有权
    用于静态类型查询的匿名类型

    公开(公告)号:US07743066B2

    公开(公告)日:2010-06-22

    申请号:US11193601

    申请日:2005-07-29

    IPC分类号: G06F7/00 G06F17/30 G06F15/16

    CPC分类号: G06F17/30421 G06F17/3041

    摘要: Anonymous types for a programming language. Non-denotable anonymous types are types that a compiler generates on behalf of a programmer and can then be used as nominal types. Insofar as anonymous types do not have a name, they can be used only inside a method in which they are created. Additionally, an anonymous type cannot be exposed in any way outside of the method. Syntax to create an anonymous type is useful when employed with a Select operator to generate a result with a particular shape, without the need of having a regular type for it. Anonymous types are expressible such that an expression of that type can be written. Translation of an anonymous type by a compiler generates a nominal class that implements Equals and GetHashCode methods. There is equivalence of anonymous types within the same method, and conversion of an unrealized structural type into structurally compatible nominal type.

    摘要翻译: 编程语言的匿名类型。 不可表示的匿名类型是编译器代表程序员生成的类型,然后可以用作标称类型。 只要匿名类型没有名称,它们只能在创建它们的方法中使用。 此外,匿名类型不能以任何方式暴露在该方法之外。 创建匿名类型的语法在与“选择”运算符一起使用以生成具有特定形状的结果时非常有用,而无需为其定义类型。 匿名类型是可表达的,使得可以写入该类型的表达式。 编译器生成一个匿名类型,生成一个实现Equals和GetHashCode方法的标称类。 在同一方法中存在匿名类型的等价物,并将未实现的结构类型转换为结构兼容的名义类型。

    Architecture that extends types using extension methods
    10.
    发明授权
    Architecture that extends types using extension methods 有权
    使用扩展方法扩展类型的体系结构

    公开(公告)号:US07685567B2

    公开(公告)日:2010-03-23

    申请号:US11192919

    申请日:2005-07-29

    IPC分类号: G06F9/44

    CPC分类号: G06F8/315

    摘要: 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.

    摘要翻译: 使用扩展方法扩展现有类型(包括构造和密封类型)的体系结构。 扩展方法是可以使用实例方法语法调用的静态方法。 扩展方法通过在方法的第一个参数上指定关键字“this”作为修饰符来声明。 扩展方法具有常规静态方法的所有功能。 另外,一旦导入,可以使用实例方法语法来调用扩展方法。 还公开了导入扩展方法和扩展方法调用的规则。 扩展方法通过using-namespace-directives导入。 除了导入命名空间中包含的类型之外,using-namespace-directive会在命名空间中的所有静态类中导入所有扩展方法。 实际上,导入的扩展方法在其第一个参数给出的类型上显示为附加方法,并且具有比常规实例方法更低的优先级。