IsReadOnlyField() public static method

public static IsReadOnlyField ( IField field ) : bool
field IField
return bool
        static bool CanLoadAddress(Node node)
        {
            IEntity entity = node.Entity;

            if (null == entity)
            {
                return(true);
            }

            switch (entity.EntityType)
            {
            case EntityType.Local:
            {
                return(!((InternalLocal)entity).IsPrivateScope);
            }

            case EntityType.Parameter:
            {
                return(true);
            }

            case EntityType.Field:
            {
                return(!TypeSystemServices.IsReadOnlyField((IField)entity));
            }
            }
            return(false);
        }
Beispiel #2
0
        static bool CanLoadAddress(Node node)
        {
            var entity = node.Entity;

            if (entity == null || node is SelfLiteralExpression)
            {
                return(true);
            }

            switch (entity.EntityType)
            {
            case EntityType.Local:
                return(!((InternalLocal)entity).IsPrivateScope);

            case EntityType.Parameter:
                return(true);

            case EntityType.Field:
                return(!TypeSystemServices.IsReadOnlyField((IField)entity));
            }
            return(false);
        }