Beispiel #1
0
        /// <summary>
        /// Convert a lua reader to reader
        /// </summary>
        public static LuaReader ToReader(this Lua.lua_Reader reader)
        {
            if (reader == null)
            {
                return(null);
            }
            var proxy = LuaReaderProxy.GetProxy(reader);

            return(proxy != null ? proxy.ManagedReader : null);
        }
Beispiel #2
0
 /// <summary>
 /// Find or create a proxy for a reader
 /// </summary>
 public static LuaReaderProxy GetProxy(LuaReader reader)
 {
     if (reader == null) return null;
     var result = FindProxy(reader);
     if (result == null)
     {
         result = new LuaReaderProxy() {
             ManagedReader = reader
         };
         result.UnmanagedReader = result.InvokeManagementReader;
         _Proxies.Add(result);
     }
     return result;
 }
Beispiel #3
0
        /// <summary>
        /// Find or create a proxy for a lua reader
        /// </summary>
        public static LuaReaderProxy GetProxy(Lua.lua_Reader reader)
        {
            if (reader == null)
            {
                return(null);
            }
            var result = FindProxy(reader);

            if (result == null)
            {
                result = new LuaReaderProxy()
                {
                    UnmanagedReader = reader
                };
                result.ManagedReader = result.InvokeUnmanagedReader;
                _Proxies.Add(result);
            }
            return(result);
        }