/// <summary> /// Creates a new AbpModuleInfo object. /// </summary> /// <param name="type"></param> /// <param name="instance"></param> public AbpModuleInfo(IAbpModule instance) { Dependencies = new List<AbpModuleInfo>(); Type = instance.GetType(); Instance = instance; Assembly = Type.Assembly; }
/// <summary> /// Creates a new AbpModuleInfo object. /// </summary> /// <param name="type"></param> /// <param name="instance"></param> public AbpModuleInfo(IAbpModule instance) { Dependencies = new List <AbpModuleInfo>(); Type = instance.GetType(); Instance = instance; Assembly = Type.Assembly; }
public AbpModuleDescriptor( [NotNull] Type type, [NotNull] IAbpModule instance, bool isLoadedAsPlugIn) { Check.NotNull(type, nameof(type)); Check.NotNull(instance, nameof(instance)); if (!type.GetTypeInfo().IsAssignableFrom(instance.GetType())) { throw new ArgumentException($"Given module instance ({instance.GetType().AssemblyQualifiedName}) is not an instance of given module type: {type.AssemblyQualifiedName}"); } Type = type; Assembly = type.Assembly; Instance = instance; IsLoadedAsPlugIn = isLoadedAsPlugIn; _dependencies = new List <IAbpModuleDescriptor>(); }