MakeStaticPropertyInstanceAccessError() public method

public MakeStaticPropertyInstanceAccessError ( PropertyTracker tracker, bool isAssignment ) : ErrorInfo
tracker PropertyTracker
isAssignment bool
return ErrorInfo
Exemplo n.º 1
0
        public override ErrorInfo GetBoundError(ActionBinder binder, DynamicMetaObject instance, Type instanceType)
        {
            MethodInfo getter = ResolveGetter(instanceType, binder.PrivateBinding);

            if (getter == null) {
                return binder.MakeMissingMemberErrorInfo(DeclaringType, Name);
            }

            if (getter.ContainsGenericParameters) {
                return binder.MakeGenericAccessError(this);
            }

            if (IsStatic) {
                return binder.MakeStaticPropertyInstanceAccessError(this, false, instance);
            }

            throw new InvalidOperationException();
        }
Exemplo n.º 2
0
        public override ErrorInfo GetBoundError(ActionBinder binder, DynamicMetaObject instance, Type instanceType)
        {
            MethodInfo getter = ResolveGetter(instanceType, binder.PrivateBinding);

            if (getter == null)
            {
                return(binder.MakeMissingMemberErrorInfo(DeclaringType, Name));
            }

            if (getter.ContainsGenericParameters)
            {
                return(binder.MakeGenericAccessError(this));
            }

            if (IsStatic)
            {
                return(binder.MakeStaticPropertyInstanceAccessError(this, false, instance));
            }

            throw new InvalidOperationException();
        }