#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 SystemNetWebResponseWrap { public static void __Register(RealStatePtr L) { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(System.Net.WebResponse); Utils.BeginObjectRegister(type, L, translator, 0, 3, 7, 2); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Close", _m_Close); Utils.RegisterFunc(L, Utils.METHOD_IDX, "Dispose", _m_Dispose); Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetResponseStream", _m_GetResponseStream); Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsFromCache", _g_get_IsFromCache); Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsMutuallyAuthenticated", _g_get_IsMutuallyAuthenticated); Utils.RegisterFunc(L, Utils.GETTER_IDX, "ContentLength", _g_get_ContentLength); Utils.RegisterFunc(L, Utils.GETTER_IDX, "ContentType", _g_get_ContentType); Utils.RegisterFunc(L, Utils.GETTER_IDX, "ResponseUri", _g_get_ResponseUri); Utils.RegisterFunc(L, Utils.GETTER_IDX, "Headers", _g_get_Headers); Utils.RegisterFunc(L, Utils.GETTER_IDX, "SupportsHeaders", _g_get_SupportsHeaders); Utils.RegisterFunc(L, Utils.SETTER_IDX, "ContentLength", _s_set_ContentLength); Utils.RegisterFunc(L, Utils.SETTER_IDX, "ContentType", _s_set_ContentType); 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) { return LuaAPI.luaL_error(L, "System.Net.WebResponse does not have a constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Close(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Close( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Dispose(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Dispose( ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_GetResponseStream(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); { System.IO.Stream gen_ret = gen_to_be_invoked.GetResponseStream( ); translator.Push(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_IsFromCache(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsFromCache); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_IsMutuallyAuthenticated(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsMutuallyAuthenticated); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_ContentLength(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushint64(L, gen_to_be_invoked.ContentLength); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_ContentType(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushstring(L, gen_to_be_invoked.ContentType); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_ResponseUri(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.ResponseUri); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_Headers(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.Headers); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_SupportsHeaders(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushboolean(L, gen_to_be_invoked.SupportsHeaders); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_ContentLength(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); gen_to_be_invoked.ContentLength = LuaAPI.lua_toint64(L, 2); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_ContentType(RealStatePtr L) { try { ObjectTranslatorChild translator = (ObjectTranslatorChild)ObjectTranslatorPool.Instance.Find(L); System.Net.WebResponse gen_to_be_invoked = (System.Net.WebResponse)translator.FastGetCSObj(L, 1); gen_to_be_invoked.ContentType = LuaAPI.lua_tostring(L, 2); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } } }