func init // adds using namespace sys.add_use('System.Collections') // initialize instance sys.add_var(this.name, 'IList') // initialize temp variable if(sys.is_linked(2) and not user_level) sys.add_var('temp', 'dynamic') end end func doAdd(value) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onAdd")) if(user_level) event("onAdd", this.codename + '.Add(' + d("value") + ')') else blk.println(this.temp, ' = ', this.codename, '.Add(', d("value"), ');') event("onAdd", this.temp) end else blk.println(this.codename, '.Add(', d("value"), ');') end end func doClear() blk.println(this.codename, ' = ', d('Interface'), ';') blk.println(this.codename, '.Clear();') end func doContains(value) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onContains")) if(user_level) event("onContains", this.codename + '.Contains(' + d("value") + ')') else blk.println(this.temp, ' = ', this.codename, '.Contains(', d("value"), ');') event("onContains", this.temp) end else blk.println(this.codename, '.Contains(', d("value"), ');') end end func doIndexOf(value) blk.println(this.codename, ' = ', d('Interface'), ';') if(linked("onIndexOf")) if(user_level) event("onIndexOf", this.codename + '.IndexOf(' + d("value") + ')') else blk.println(this.temp, ' = ', this.codename, '.IndexOf(', d("value"), ');') event("onIndexOf", this.temp) end else blk.println(this.codename, '.IndexOf(', d("value"), ');') end end func doInsert(index, value) blk.println(this.codename, ' = ', d('Interface'), ';') blk.println(this.codename, '.Insert(', d("index"), ', ', d("value"), ');') end func doRemove(value) blk.println(this.codename, ' = ', d('Interface'), ';') blk.println(this.codename, '.Remove(', d("value"), ');') end func doRemoveAt(index) blk.println(this.codename, ' = ', d('Interface'), ';') blk.println(this.codename, '.RemoveAt(', d("index"), ');') end func IsFixedSize blk.println(this.codename, ' = ', d('Interface'), ';') return(this.codename + '.IsFixedSize') end func IsReadOnly blk.println(this.codename, ' = ', d('Interface'), ';') return(this.codename + '.IsReadOnly') end func Item blk.println(this.codename, ' = ', d('Interface'), ';') return(this.codename + '[' && d('index') && ']') end func doItem(value) blk.println(this.codename, ' = ', d('Interface'), ';') blk.println(this.codename, '[', d('index'), '] = ', d("value"), ';') end include("IEnumerableInherit") include("ICollectionInherit")