public PackageSourceDescriptor([NotNull] IPackageSource source, [NotNull] PackageSourceAttribute attribute) { Assert.ArgumentNotNull(source, nameof(source)); Assert.ArgumentNotNull(attribute, nameof(attribute)); Source = source; Attribute = attribute; }
public static void LoadType([NotNull] Type type, [NotNull] PackageSourceAttribute attribute) { Assert.ArgumentNotNull(type, nameof(type)); Assert.ArgumentNotNull(attribute, nameof(attribute)); var source = Activator.CreateInstance(type) as IPackageSource; if (source == null) { return; } var descriptor = new PackageSourceDescriptor(source, attribute); sources.Add(descriptor); }