コード例 #1
0
            public PackageSourceDescriptor([NotNull] IPackageSource source, [NotNull] PackageSourceAttribute attribute)
            {
                Assert.ArgumentNotNull(source, nameof(source));
                Assert.ArgumentNotNull(attribute, nameof(attribute));

                Source    = source;
                Attribute = attribute;
            }
コード例 #2
0
        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);
        }