c1_unity/Assets/XLua/Gen/System_ComponentModel_AsyncCompletedEventArgsWrap.cs
2023-04-03 11:04:31 +08:00

133 lines
4.2 KiB
C#

#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif
using XLua;
using System.Collections.Generic;
namespace XLua.CSObjectWrap
{
using Utils = XLua.Utils;
public class SystemComponentModelAsyncCompletedEventArgsWrap
{
public static void __Register(RealStatePtr L)
{
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.Type type = typeof(System.ComponentModel.AsyncCompletedEventArgs);
Utils.BeginObjectRegister(type, L, translator, 0, 0, 3, 0);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Cancelled", _g_get_Cancelled);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "Error", _g_get_Error);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "UserState", _g_get_UserState);
Utils.EndObjectRegister(type, L, translator, null, null,
null, null, null);
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
Utils.EndClassRegister(type, L, translator);
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int __CreateInstance(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
if(LuaAPI.lua_gettop(L) == 4 && translator.Assignable<System.Exception>(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3) && translator.Assignable<object>(L, 4))
{
System.Exception _error = (System.Exception)translator.GetObject(L, 2, typeof(System.Exception));
bool _cancelled = LuaAPI.lua_toboolean(L, 3);
object _userState = translator.GetObject(L, 4, typeof(object));
var gen_ret = new System.ComponentModel.AsyncCompletedEventArgs(_error, _cancelled, _userState);
translator.Push(L, gen_ret);
return 1;
}
}
catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return LuaAPI.luaL_error(L, "invalid arguments to System.ComponentModel.AsyncCompletedEventArgs constructor!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_Cancelled(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.ComponentModel.AsyncCompletedEventArgs gen_to_be_invoked = (System.ComponentModel.AsyncCompletedEventArgs)translator.FastGetCSObj(L, 1);
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.Cancelled);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 1;
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_Error(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.ComponentModel.AsyncCompletedEventArgs gen_to_be_invoked = (System.ComponentModel.AsyncCompletedEventArgs)translator.FastGetCSObj(L, 1);
translator.Push(L, gen_to_be_invoked.Error);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 1;
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_UserState(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.ComponentModel.AsyncCompletedEventArgs gen_to_be_invoked = (System.ComponentModel.AsyncCompletedEventArgs)translator.FastGetCSObj(L, 1);
translator.PushAny(L, gen_to_be_invoked.UserState);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 1;
}
}
}