internal ClassMember SetItem(RuntimeContexts.RuntimeContext context, bool isStatic) { var members = isStatic ? StaticMembers : InstanceMembers; ClassMember value; string rename; string idxget = ClassHelper.RenameIndexerGetter; string idxset = ClassHelper.RenameIndexerSetter; var cls = context.Class as ClassObject; if (cls != null) { rename = ClassHelper.RenamePrivate(idxset, cls.Name); if (members.TryGetValue(rename, out value) && value is IndexerSetter) { return(value); } rename = ClassHelper.RenamePrivate(idxget, cls.Name); if (members.TryGetValue(rename, out value) && value is IndexerGetter) { return(ClassHelper.ThrowIndexerIsReadonly()); } } { rename = idxset; if (members.TryGetValue(rename, out value) && value is IndexerSetter) { return(value); } rename = idxget; if (members.TryGetValue(rename, out value) && value is IndexerGetter) { return(ClassHelper.ThrowIndexerIsReadonly()); } } if (cls == this || ClassHelper.IsExtendedFrom(this, cls) || ClassHelper.IsExtendedFrom(cls, this)) { rename = ClassHelper.RenameProtected(idxset); if (members.TryGetValue(rename, out value) && value is IndexerSetter) { return(value); } rename = ClassHelper.RenameProtected(idxget); if (members.TryGetValue(rename, out value) && value is IndexerGetter) { return(ClassHelper.ThrowIndexerIsReadonly()); } } if (Super != null) { return(Super.SetItem(context, isStatic)); } return(ClassHelper.ThrowIndexerNotSupported()); }