Esempio n. 1
0
        public ArrayList lt2ArrayList(LuaEx lua, string keyword)
        {
            LuaInterface.LuaTable lt  = lua.GetTable(keyword);
            ArrayList             ret = new ArrayList();

            if (lt == null)
            {
                return(ret);
            }
            foreach (object k in lt.Keys)
            {
                object[] astr = { k.ToString(), lt[k].ToString() };
                ret.Add(astr);
            }
            return(ret);
            //ret.Count
        }
Esempio n. 2
0
        public string lt2ArrayList_parms(LuaEx lua, string keyword)
        {
            string ret = keyword;

            try
            {
                LuaInterface.LuaTable lt = (LuaInterface.LuaTable)(lua.DoString("return debug.getinfo(" + keyword + ")")[0]);
                if (lt["what"].ToString() == "Lua")
                {
                    ret += "(";
                    ret += lt["strparms"].ToString();
                    if (lt["has3dot"].ToString() == "1")
                    {
                        ret += ",...";
                    }
                    ret += ")";
                }
            }
            catch
            {
                ret = "";
            }
            return(ret);
        }
Esempio n. 3
0
File: Form1.cs Progetto: viticm/pap2
 public string lt2ArrayList_parms(LuaEx lua, string keyword)
 {   
     string ret = keyword;
     try
     {
         LuaInterface.LuaTable lt = (LuaInterface.LuaTable)(lua.DoString("return debug.getinfo(" + keyword + ")")[0]);
         if (lt["what"].ToString() == "Lua")
         {
             ret += "(";
             ret += lt["strparms"].ToString();
             if (lt["has3dot"].ToString() == "1")
                 ret += ",...";
             ret += ")";
         }
     }
     catch
     {
         ret = "";
     }
     return (ret);
 }
Esempio n. 4
0
File: Form1.cs Progetto: viticm/pap2
 public ArrayList lt2ArrayList(LuaEx lua, string keyword)
 {
     LuaInterface.LuaTable lt = lua.GetTable(keyword);
     ArrayList ret = new ArrayList();
     if (lt == null) return ret;
     foreach (object k in lt.Keys)
     {
         object[] astr = { k.ToString(), lt[k].ToString() };
         ret.Add(astr);
     }
     return ret;
     //ret.Count
 }