-
Notifications
You must be signed in to change notification settings - Fork 202
attributes_en
YANG Huan edited this page Dec 29, 2020
·
4 revisions
Some attributes can be marked in the documentation comments to control the behavior of the compiler.
/// <summary>
/// @CSharpLua.NoField
/// </summary>
public int Field { get; set; }
Automatic properties are not processed into fields, and corresponding get and set functions are generated.
/// <summary>
/// @CSharpLua.Ignore
/// </summary>
public class A { }
This class is not exported to the generated lua file, and attributes can be applied to classes, methods, and properties.
public static class Api {
/// <summary>
/// @CSharpLua.Template = "print({0})"
/// </summary>
public extern static void Print(object a);
/// <summary>
/// @CSharpLua.Template = "print({0}, {1})"
/// </summary>
public extern static void Print(object a, object b);
/// <summary>
/// @CSharpLua.Template = "print({*0})"
/// </summary>
public extern static void Print(params object[] args);
}
This attribute can be applied to methods or fields. Template writing rules can be referenced. How to change some of the generated behavior's Description of part 1.
/// <summary>
/// @CSharpLua.Params
/// </summary>
public static void Print(string format, params object[] args)
{
}
output
Print = function (format, ...)
end