MakeStaticPropertyInstanceAccessError() public méthode

public MakeStaticPropertyInstanceAccessError ( PropertyTracker tracker, bool isAssignment ) : ErrorInfo
tracker PropertyTracker
isAssignment bool
Résultat ErrorInfo
Exemple #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();
        }
Exemple #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();
        }