using System;
using System.Collections.Generic;
using System.Reflection;
using JetBrains.Annotations;
namespace Abp.Modules
{
///
/// Used to store all needed information for a module.
///
public class AbpModuleInfo
{
///
/// The assembly which contains the module definition.
///
public Assembly Assembly { get; }
///
/// Type of the module.
///
public Type Type { get; }
///
/// Instance of the module.
///
public AbpModule Instance { get; }
///
/// Is this module loaded as a plugin.
///
public bool IsLoadedAsPlugIn { get; }
///
/// All dependent modules of this module.
///
public List Dependencies { get; }
///
/// Creates a new AbpModuleInfo object.
///
public AbpModuleInfo([NotNull] Type type, [NotNull] AbpModule instance, bool isLoadedAsPlugIn)
{
Check.NotNull(type, nameof(type));
Check.NotNull(instance, nameof(instance));
Type = type;
Instance = instance;
IsLoadedAsPlugIn = isLoadedAsPlugIn;
Assembly = Type.GetTypeInfo().Assembly;
Dependencies = new List();
}
public override string ToString()
{
return Type.AssemblyQualifiedName ??
Type.FullName;
}
}
}