private void CreateList(Type[] types) { SubClassTypeList list = new SubClassTypeList(this, types); list.Update(); _list.Add(types, list); }
/// <summary> /// This will return a list of types that are subclasses of all types in basetypes or (when basetype[i] is an interface) /// implements basetypes[i]. /// </summary> /// <param name="basetypes">The basetypes.</param> /// <returns></returns> public static System.Type[] GetSubclassesOf(System.Type[] basetypes) { SubClassTypeList tlist = _subClassTypeListCollection[basetypes]; List <Type> list = new List <Type>(); list.AddRange(tlist); return(list.ToArray()); }
public SubClassTypeList this[Type[] types] { get { if (!_list.ContainsKey(types)) { CreateList(types); } SubClassTypeList result = _list[types]; result.Update(); return(result); } }
/// <summary> /// This will return a list of types that are subclasses of type basetype or (when basetype is an interface) /// implements basetype. /// </summary> /// <param name="basetypes">The basetype.</param> /// <returns></returns> public static System.Type[] GetNonAbstractSubclassesOf(System.Type[] basetypes) { SubClassTypeList tlist = _subClassTypeListCollection[basetypes]; List <Type> list = new List <Type>(); foreach (Type definedtype in tlist) { if (!definedtype.IsAbstract) { list.Add(definedtype); } } // end foreach type return(list.ToArray()); }
private void UpdateForManyBasetypes() { int loadedAssemblyCount = _loadedAssemblies.Count; if (_currentAssemblyCount == loadedAssemblyCount) { return; } SubClassTypeList tl = _parent[new Type[] { _baseType }]; foreach (Type definedtype in tl.GetSubTypeRange(_currentAssemblyCount, loadedAssemblyCount - _currentAssemblyCount)) { if (IsSubClassOfOrImplements(definedtype, _moreTypes)) { _listOfTypes.Add(definedtype); } } _currentAssemblyCount = loadedAssemblyCount; }