public ILuaAttachedScript AttachScript(string scriptId, LuaTable table, bool autoRun) { using (EnterReadLock()) { // Gibt es die Verbindung schon lock (globals) { foreach (var c in globals) { if (String.Compare(c.ScriptId, scriptId, true) == 0 && c.LuaTable == table) { return(c); } } } // Lege die Verbindung an var ag = new LuaAttachedGlobal(this, scriptId, table, autoRun); lock (globals) globals.Add(ag); return(ag); } } // func AttachScript
} // func GetAttachedGlobals private void RemoveAttachedGlobal(LuaAttachedGlobal item) { lock (globals) globals.Remove(item); } // func RemoveAttachedGlobal