Boo.Lang.Compiler.TypeSystem.NameResolutionService.GetEntityFromList C# (CSharp) Метод

GetEntityFromList() публичный статический Метод

public static GetEntityFromList ( IList list ) : IEntity
list IList
Результат IEntity
        public static IEntity GetEntityFromList(IList list)
        {
            IEntity element = null;
            if (list.Count > 0)
            {
                if (list.Count > 1)
                {
                    element = new Ambiguous(list);
                }
                else
                {
                    element = (IEntity)list[0];
                }
                list.Clear();
            }
            return element;
        }

Usage Example

Пример #1
0
        public IEntity GetDefaultMember()
        {
            IType defaultMemberAttribute = _typeSystemServices.Map(typeof(DefaultMemberAttribute));

            foreach (Attribute attribute in _typeDefinition.Attributes)
            {
                IConstructor tag = TypeSystemServices.GetEntity(attribute) as IConstructor;
                if (null != tag)
                {
                    if (defaultMemberAttribute == tag.DeclaringType)
                    {
                        StringLiteralExpression memberName = attribute.Arguments[0] as StringLiteralExpression;
                        if (null != memberName)
                        {
                            List buffer = new List();
                            Resolve(buffer, memberName.Value, EntityType.Any);
                            return(NameResolutionService.GetEntityFromList(buffer));
                        }
                    }
                }
            }
            if (null != BaseType)
            {
                return(BaseType.GetDefaultMember());
            }
            return(null);
        }
All Usage Examples Of Boo.Lang.Compiler.TypeSystem.NameResolutionService::GetEntityFromList