namespace Sandbox;
///
/// An attribute that can be added to a custom class for special code generation behavior.
/// They'll then be applied to methods and properties when they are decorated with that attribute.
///
[AttributeUsage( AttributeTargets.Class, AllowMultiple = true )]
public class CodeGeneratorAttribute : Attribute
{
///
/// Attributes with a higher priority will wrap the target first. The default priority is 0.
///
public int Priority { get; init; } = 0;
///
/// 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.
///
public string CallbackName { get; init; }
///
/// 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
/// and flags.
///
public CodeGeneratorFlags Type { get; init; }
///
/// Perform code generation for a method or property.
///
///
/// 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
/// and flags.
///
///
/// 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.
///
///
/// Attributes with a higher priority will wrap the target first. The default priority is 0.
///
public CodeGeneratorAttribute( CodeGeneratorFlags type, string callbackName, int priority = 0 )
{
CallbackName = callbackName;
Priority = 0;
Type = type;
}
}