Beispiel #1
0
            public override DynamicMetaObject /*!*/ FallbackGetMember(DynamicMetaObject /*!*/ target, DynamicMetaObject errorSuggestion)
            {
                if (_unmangled != null)
                {
                    // TODO: errorSuggestion?
                    return(_unmangled.Bind(target, DynamicMetaObject.EmptyMetaObjects));
                }

#if !SILVERLIGHT
                DynamicMetaObject result;
                if (Microsoft.Scripting.ComInterop.ComBinder.TryBindGetMember(this, target, out result))
                {
                    return(result);
                }
#endif

                var metaBuilder = new MetaObjectBuilder(target);
                var callArgs    = new CallArguments(_context, target, DynamicMetaObject.EmptyMetaObjects, _CallInfo);

                if (!RubyCallAction.BuildAccess(metaBuilder, _originalName ?? Name, callArgs, errorSuggestion == null, true))
                {
                    Debug.Assert(errorSuggestion != null);
                    metaBuilder.SetMetaResult(errorSuggestion, false);
                }

                return(metaBuilder.CreateMetaObject(this));
            }