lua.RegisterFunction(method.Name,null,method);// CLR name
else
lua.RegisterFunction(attribute.Name,null,method);// Custom name
lua.RegisterFunction(attribute.Name,null,method);// Custom name
}
}
}
...
...
@@ -100,26 +95,25 @@ namespace LuaInterface
/// <typeparam name="T">The enum type to register</typeparam>
/// <param name="lua">The Lua VM to add the enum to</param>
[SuppressMessage("Microsoft.Design","CA1004:GenericMethodsShouldProvideTypeParameter",Justification="The type parameter is used to select an enum type")]
publicstaticvoidEnumeration<T>(Lualua)
publicstaticvoidEnumeration<T>(Lualua)
{
#regionSanitychecks
if(lua.IsNull())
thrownewArgumentNullException("lua");
if(lua.IsNull())
thrownewArgumentNullException("lua");
#endregion
vartype=typeof(T);
if(!type.IsEnum)
thrownewArgumentException("The type must be an enumeration!");
if(!type.IsEnum)
thrownewArgumentException("The type must be an enumeration!");