/// <summary> /// Convert a lua writer to writer /// </summary> public static LuaWriter ToWriter(this Lua.lua_Writer writer) { if (writer == null) { return(null); } var proxy = LuaWriterProxy.GetProxy(writer); return(proxy != null ? proxy.ManagedWriter : null); }
/// <summary> /// Find or create a proxy for a writer /// </summary> public static LuaWriterProxy GetProxy(LuaWriter writer) { if (writer == null) return null; var result = FindProxy(writer); if (result == null) { result = new LuaWriterProxy() { ManagedWriter = writer }; result.UnmanagedWriter = result.InvokeManagementWriter; _Proxies.Add(result); } return result; }
/// <summary> /// Find or create a proxy for a lua writer /// </summary> public static LuaWriterProxy GetProxy(Lua.lua_Writer writer) { if (writer == null) { return(null); } var result = FindProxy(writer); if (result == null) { result = new LuaWriterProxy() { UnmanagedWriter = writer }; result.ManagedWriter = result.InvokeUnmanagedWriter; _Proxies.Add(result); } return(result); }