GetMember with a fallback that returns OperationFailed singleton. No name mangling is performed.
Inheritance: System.Dynamic.GetMemberBinder, IInvokeOnGetBinder
Example #1
0
        public InteropBinder.TryGetMemberExact /*!*/ InteropTryGetMemberExact(string /*!*/ name)
        {
            if (_interopTryGetMemberExact == null)
            {
                Interlocked.CompareExchange(ref _interopTryGetMemberExact, new Dictionary <string, InteropBinder.TryGetMemberExact>(), null);
            }

            lock (_interopTryGetMemberExact) {
                InteropBinder.TryGetMemberExact result;
                if (!_interopTryGetMemberExact.TryGetValue(name, out result))
                {
                    _interopTryGetMemberExact.Add(name, result = new InteropBinder.TryGetMemberExact(_context, name));
                }
                return(result);
            }
        }
Example #2
0
        public static InteropBinder.TryGetMemberExact /*!*/ InteropTryGetMemberExact(string /*!*/ name)
        {
            if (_interopTryGetMemberExact == null)
            {
                _interopTryGetMemberExact = new Dictionary <string, InteropBinder.TryGetMemberExact>();
            }

            lock (_interopTryGetMemberExact) {
                InteropBinder.TryGetMemberExact result;
                if (!_interopTryGetMemberExact.TryGetValue(name, out result))
                {
                    _interopTryGetMemberExact.Add(name, result = new InteropBinder.TryGetMemberExact(name));
                }
                return(result);
            }
        }