/// <summary> /// Get all types referenced by the types from specified assembly. /// </summary> /// <param name="assembly"></param> /// <param name="settings"></param> /// <returns></returns> public static TypeCollection ForReferencedTypes(Assembly assembly, ReflectionSettings settings = null) { var typeCollection = new TypeCollection(); typeCollection.GetReferencedTypes(assembly, settings); return(typeCollection); }
protected void Init(ReflectionSettings settings) { Settings = settings ?? ReflectionSettings.Default; ReferencedTypes = new Dictionary <Type, TypeInformation>(); VisitedPropTypes = new HashSet <Type>(); PendingPropTypes = new Queue <Type>(); CheckAssemblies = new Dictionary <Assembly, bool>(); IgnoreTypes = new HashSet <Type>(); }
/// <summary> /// Get all types referenced by the types from specified assembly. /// </summary> /// <param name="assembly"></param> /// <param name="settings"></param> public void GetReferencedTypes(Assembly assembly, ReflectionSettings settings = null) { Init(settings); foreach (var type in assembly.GetTypes()) { PendingPropTypes.Enqueue(type); } ProcessTypeQueue(); }
/// <summary> /// Get all types referenced by the types from specified assemblies. /// Reflection information for the specified type is also returned. /// </summary> /// <param name="assemblies"></param> /// <param name="settings"></param> /// <returns></returns> public void GetReferencedTypes(IEnumerable <Assembly> assemblies, ReflectionSettings settings = null) { Init(settings); foreach (var assembly in assemblies) { foreach (var type in assembly.GetTypes()) { PendingPropTypes.Enqueue(type); } } ProcessTypeQueue(); }
/// <summary> /// Get all types referenced by the specified type. /// Reflection information for the specified type is also returned. /// </summary> /// <param name="type"></param> /// <param name="settings"></param> public void GetReferencedTypes(Type type, ReflectionSettings settings = null) { Init(settings); PendingPropTypes.Enqueue(type); ProcessTypeQueue(); }
/// <summary> /// Get all types referenced by the types from the list of assemblies. /// </summary> /// <param name="assemblies"></param> /// <param name="settings"></param> /// <returns></returns> public static TypeCollection ForReferencedTypes(IEnumerable <Assembly> assemblies, ReflectionSettings settings = null) { var typeCollection = new TypeCollection(); typeCollection.GetReferencedTypes(assemblies, settings); return(typeCollection); }