public IMember GetMember(IModuleContext context, string name) { var res = GetOne(name, context == null || ((IronPythonModuleContext)context).ShowClr); if (res != this) { return(_interpreter.MakeObject(res)); } return(null); }
public IMember GetMember(IModuleContext context, string name) { if (_attrs == null) { Interlocked.CompareExchange(ref _attrs, new Dictionary <string, MemberInfo>(), null); } bool showClr = context == null || ((IronPythonModuleContext)context).ShowClr; MemberInfo member; if (!_attrs.TryGetValue(name, out member) || member.Member == null) { var ri = RemoteInterpreter; var res = ri != null?ri.GetMember(Value, name) : default(ObjectIdentityHandle); if (!res.Equals(Value)) { _attrs[name] = member = new MemberInfo(_interpreter.MakeObject(res)); } } if (!showClr) { if (!(this is IronPythonNamespace)) // namespaces always show all of their members... { switch (member.ClrOnly) { case IsClrOnly.NotChecked: CreateNonClrAttrs(); if (_attrs.ContainsKey(name) && _attrs[name].ClrOnly == IsClrOnly.Yes) { return(null); } break; case IsClrOnly.No: break; case IsClrOnly.Yes: return(null); } } } return(member.Member); }