AutoInjectIntoTargetAttribute Class

From The Oxygene Language Wiki

Jump to:navigation, search

This is a Language topic
Feel free to add your notes to this topic below.


[AttributeUsage((AttributeTargets.&Event or AttributeTargets.Field or 
 AttributeTargets.&Property or AttributeTargets.&Method, 
 AllowMultiple := false, &Inherited := true)]
AutoInjectIntoTargetAttribute = public sealed class(Attribute, IMethodImplementationDecorator, 
  IMethodInterfaceDecorator, IPropertyInterfaceDecorator, IPropertyImplementationDecorator, 
  IEventInterfaceDecorator, IEventImplementationDecorator, IFieldInterfaceDecorator, IBaseAspect)

Specialized aspect attribute to automatically create a method in the class this attribute is applied to. Use it like this:

[aspect:AutoInjectIntoTarget]
 method Test(s: string): string;

The aspect code adds a new method to the class, called 'Test', adds the parameter and sets the result. Then it creates the code needed to insert the original method body of that method into the target.


Namespace: Cirrus


Members

Method
Description
constructorConstructor for this class


Properties

Property
Description
External: BooleanIf true, this method will be an external method (dllimport or com)
Final: BooleanUse this property to make sure a method cannot be inherited from
Virtual: BooleanUse this property to make this member virtual, override or abstract


See Also

Oxygene-48.png

Area: Oxygene Language
Compiler version: Oxygene 5

Language GlossaryKeywordsTypesFAQHow To

Navigation
Areas
More
Toolbox