Boo.Lang.Compiler.TypeSystem.Ambiguous.AllEntitiesAre C# (CSharp) Method

AllEntitiesAre() public method

public AllEntitiesAre ( EntityType entityType ) : bool
entityType EntityType
return bool
        public bool AllEntitiesAre(EntityType entityType)
        {
            foreach (IEntity entity in _entities)
            {
                if (entityType != entity.EntityType) return false;
            }
            return true;
        }

Usage Example

Beispiel #1
0
        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;
        }
All Usage Examples Of Boo.Lang.Compiler.TypeSystem.Ambiguous::AllEntitiesAre