Пример #1
0
 /// <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;
 }
Пример #2
0
 /// <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;
 }
Пример #3
0
    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>();
    }