CodeGeneratorAttributeclass

An attribute that can be added to a custom `System.Attribute` class for special code generation behavior. They'll then be applied to methods and properties when they are decorated with that attribute.

objectAttributeCodeGeneratorAttribute
Namespace
Sandbox
Assembly
Sandbox.System
Declaration
public class Sandbox.CodeGeneratorAttribute : System.Attribute

Constructors1

Showing 1 constructors

public CodeGeneratorAttribute(Sandbox.CodeGeneratorFlags type, string callbackName, int priority = 0)PUBLICCONSTRUCTOR

Perform code generation for a method or property.

ParameterTypeDescription
typeCodeGeneratorFlagsThe type of code generation you want to do. You will need to specify whether it should apply to instance or static methods and properties using the `Sandbox.CodeGeneratorFlags.Instance` and `Sandbox.CodeGeneratorFlags.Static` flags.
callbackNamestringThe name of the callback method. This can be a fully qualified static method callback or a simple callback to invoke on the target object if the method or property target is not static.
priority = 0intAttributes with a higher priority will wrap the target first. The default priority is 0.

Properties3

Showing 3 properties

public string Sandbox.CodeGeneratorAttribute.CallbackName { get; set; }PUBLICGETSET

The name of the callback method. This can be a fully qualified static method callback or a simple callback to invoke on the target object if the method or property target is not static.

Returns:string

public int Sandbox.CodeGeneratorAttribute.Priority { get; set; }PUBLICGETSET

Attributes with a higher priority will wrap the target first. The default priority is 0.

Returns:int

public Sandbox.CodeGeneratorFlags Sandbox.CodeGeneratorAttribute.Type { get; set; }PUBLICGETSET

The type of code generation you want to do. You will need to specify whether it should apply to instance or static methods and properties using the `Sandbox.CodeGeneratorFlags.Instance` and `Sandbox.CodeGeneratorFlags.Static` flags.

On this page