AllEntitiesAre() public method

public AllEntitiesAre ( EntityType entityType ) : bool
entityType EntityType
return bool
コード例 #1
0
ファイル: ProcessMethodBodies.cs プロジェクト: stuman08/boo
        private IEntity ResolveAmbiguousLValue(Expression sourceNode, Ambiguous candidates, Expression rvalue)
        {
            if (!candidates.AllEntitiesAre(EntityType.Property)) return null;

            IEntity[] entities = candidates.Entities;
            IEntity[] getters = GetSetMethods(entities);
            ExpressionCollection args = new ExpressionCollection();
            args.Add(rvalue);
            IEntity found = GetCorrectCallableReference(sourceNode, args, getters);
            if (null != found && EntityType.Method == found.EntityType)
            {
                IProperty property = (IProperty)entities[GetIndex(getters, found)];
                BindProperty(sourceNode, property);
                return property;
            }
            return null;
        }
コード例 #2
0
        private IEntity ResolveAmbiguousReference(ReferenceExpression node, Ambiguous candidates)
        {
            if (!AstUtil.IsTargetOfSlicing(node)
                && !AstUtil.IsLhsOfAssignment(node))
            {
                if (candidates.AllEntitiesAre(EntityType.Property))
                {
                    return ResolveAmbiguousPropertyReference(node, candidates, EmptyExpressionCollection);
                }
                else if (candidates.AllEntitiesAre(EntityType.Method))
                {
                    return ResolveAmbiguousMethodReference(node, candidates, EmptyExpressionCollection);
                    }
                else if (candidates.AllEntitiesAre(EntityType.Type))
                {
                    return ResolveAmbiguousTypeReference(node, candidates);
                }
            }

            return ResolveAmbiguousReferenceByAccessibility(candidates);
        }