public static IEnumerable <TMember> Select <TMember>(this TypeMember type, Func <TMember, bool> where = null) where TMember : AbstractMember { var selector = type.Members.OfType <TMember>(); if (where != null) { selector = selector.Where(where); } return(selector); }
public static IEnumerable <TMember> SelectPublicInstance <TMember>(this TypeMember type, Func <TMember, bool> where = null) where TMember : AbstractMember { var selector = Select <TMember>(type, where) .Where(m => m.Visibility == MemberVisibility.Public && (m.Modifier & MemberModifier.Static) == 0 ); return(selector); }
public bool Equals(TypeMember other) { if (ReferenceEquals(other, null)) { return(false); } //TODO: compare by bindings //if (this.ClrBinding != null) //{ // return (this.ClrBinding == other.ClrBinding); //} return(ReferenceEquals(this, other)); }
public bool IsAssignableFrom(TypeMember other) { while (!ReferenceEquals(other, null)) { if (ReferenceEquals(other, this)) { return(true); } if (other.Interfaces.Contains(this)) { return(true); } other = other.BaseType; } return(false); }
public AttributeDescription TryGetAttribute(TypeMember attributeType) { return(Attributes.FirstOrDefault(attr => attr.AttributeType == attributeType)); }
public TypeGeneratorInfo(Type factoryType, TypeKey?typeKey, TypeMember activationContract) { FactoryType = factoryType; TypeKey = typeKey; ActivationContract = activationContract; }
public IEnumerable <TMember> Attribute(TypeMember attributeType) { return(_source.Where(t => t.Attributes.Any(a => a.AttributeType == attributeType))); }