Code blueprints
    1.
    发明授权
    Code blueprints 有权
    代码蓝图

    公开(公告)号:US07500224B2

    公开(公告)日:2009-03-03

    申请号:US10285849

    申请日:2002-11-01

    IPC分类号: G06F9/44

    CPC分类号: G06F8/51

    摘要: A blueprint is described that provides a framework for writing a code generator. A blueprint translator translates the blueprint into one or more classes with source code. The newly generated code can then be compiled. If the user wishes to add additional functionality to a generated class, this is done in a separate source file. At compilation time, the compiler combines the generated class with the user's additions, as if they were written in a single class. Later, if the blueprint is ever changed, the generated code can safely be updated without overwriting the user's additions. Alternately, the user can embed his desired additions or changes directly into the blueprint (embedded code). In this manner, should the blueprint ever be re-compiled, the user's changes will still be present. The partial classes technique can be used in conjunction with the embedded code technique.

    摘要翻译: 描述了提供编写代码生成器的框架的蓝图。 蓝图翻译器将蓝图转换为一个或多个具有源代码的类。 然后可以编译新生成的代码。 如果用户希望为生成的类添加附加功能,则可以在单独的源文件中完成。 在编译时,编译器将生成的类与用户的添加相结合,就好像它们被编写在一个类中一样。 之后,如果蓝图发生变化,生成的代码可以安全地更新,而不会覆盖用户的添加。 或者,用户可以将他想要的添加或改变直接嵌入到蓝图(嵌入代码)中。 以这种方式,如果蓝图有待重新编译,用户的变化仍然存在。 部分类技术可以与嵌入式代码技术结合使用。

    Delegate-based event handling
    2.
    发明授权
    Delegate-based event handling 失效
    基于代理的事件处理

    公开(公告)号:US06951022B1

    公开(公告)日:2005-09-27

    申请号:US09808263

    申请日:2001-03-14

    IPC分类号: G06F9/46

    CPC分类号: G06F9/542

    摘要: A delegate-based event-driven programming model facilitates application development by allowing event handlers to be manipulated on an individual basis. In the delegate-based event-driven programming model, the recipient of an event need not be aware that is receiving the event because the event is treated as a call from a method. In addition, event handlers can be dynamically manipulated, such that recipients of events can be added or removed during runtime. Flexibility of event handling is improved as a result.

    摘要翻译: 基于代理的事件驱动的编程模型通过允许事件处理程序在个别基础上进行操作来促进应用程序开发。 在基于委托的事件驱动的编程模型中,事件的收件人不需要意识到正在接收事件,因为事件被视为来自方法的调用。 此外,可以动态地处理事件处理程序,以便可以在运行时添加或删除事件的接收者。 结果提高了事件处理的灵活性。

    Method, software and apparatus for referencing a method in object-based programming
    3.
    发明授权
    Method, software and apparatus for referencing a method in object-based programming 失效
    用于引用基于对象的编程中的方法的方法,软件和装置

    公开(公告)号:US06381734B1

    公开(公告)日:2002-04-30

    申请号:US09089619

    申请日:1998-06-03

    IPC分类号: G06F945

    CPC分类号: G06F9/449

    摘要: Method and apparatus for encapsulating a reference to a method in object-based programming systems and ensuring that the reference is safe are disclosed. The method of encapsulation provides for: a) defining an entity that defines the shape of the method to be referenced; b) obtaining a reference to a method; c) storing this reference in arbitrary data structures; d) passing the reference to code written by other parties; e) enabling invocation of the method by anyone holding the method reference; and f) enabling the holder of a method reference to determine the target object and method being referenced. These objectives are achieved in a strongly typed manner, making it possible for: a) developers to learn of type mismatch problems early (at compile-time) rather than late (at run-time); and b) development tools to present information to developers about the shape of components that use delegates. In addition, a model of event based programming is disclosed, wherein event-related code can be encapsulated in delegates.

    摘要翻译: 公开了一种用于封装对基于对象的编程系统中的方法的参考并确保参考是安全的方法和装置。 封装方法提供:a)定义定义要引用的方法的形状的实体; b)获得对方法的引用; c)将此参考存储在任意数据结构中; d)传递其他方面编写的代码; e)允许任何持有方法引用的方法的调用; 以及f)使得方法引用的持有人能够确定所引用的目标对象和方法。 这些目标是以强力类型的方式实现的,从而有可能:a)开发人员早期(在编译时)而不是迟到(在运行时)学习类型不匹配问题; 和b)开发工具向开发人员介绍使用代表的组件的形状。 另外,公开了一种基于事件的编程的模型,其中事件相关代码可以封装在委托中。

    Architecture that extends types using extension methods
    7.
    发明授权
    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
    10.
    发明授权
    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方法的标称类。 在同一方法中存在匿名类型的等价物,并将未实现的结构类型转换为结构兼容的名义类型。