示例#1
0
        /// <summary>
        /// Gets a table within this table.
        /// </summary>
        /// <param name="name">Name of the table</param>
        /// <returns></returns>
        public ScriptTable GetTable(string name)
        {
            var scriptPtr = NativeScriptTableMethods.GetSubScriptTable(Handle, name);

            if (scriptPtr != IntPtr.Zero)
            {
                var scriptTable = ScriptTables.FirstOrDefault(x => x.Handle == scriptPtr);
                if (scriptTable != default(ScriptTable))
                {
                    return(scriptTable);
                }

                scriptTable = new ScriptTable(scriptPtr);
                ScriptTables.Add(scriptTable);
                return(scriptTable);
            }

            return(null);
        }