public ProviderRegistrationAttribute(ProviderRegistrationType knownType)
        {
            if (knownType == ProviderRegistrationType.Custom)
                throw RuntimeFailure.UseProviderRegistrationAttributeOverload("knownType", knownType);

            this.registration = ProviderRegistration.FromKind(knownType);
        }
        public ProviderRegistrationAttribute(Type type)
        {
            if (type == null)
                throw new ArgumentNullException("type");
            if (!typeof(IProviderRegistration).IsAssignableFrom(type))
                throw Failure.NotAssignableFrom("type", typeof(IProviderRegistration), type);

            this.registration = (IProviderRegistration) Activator.CreateInstance(type);
        }
示例#3
0
        public ProviderRegistrationAttribute(ProviderRegistrationType knownType)
        {
            if (knownType == ProviderRegistrationType.Custom)
            {
                throw RuntimeFailure.UseProviderRegistrationAttributeOverload("knownType", knownType);
            }

            this.registration = ProviderRegistration.FromKind(knownType);
        }
示例#4
0
        static IEnumerable <Type> GetRootProviderTypes(Assembly a)
        {
            IProviderRegistration       registration = AssemblyInfo.GetAssemblyInfo(a).GetProviderRegistration();
            ProviderRegistrationContext context      = new ProviderRegistrationContext(a);

            registration.RegisterRootProviderTypes(context);

            return(context.EnumerateRoots());
        }
示例#5
0
        private static IEnumerable <ProviderValueSource> ExtractFromTypes(Assembly a)
        {
            IProviderRegistration       registration = AssemblyInfo.GetAssemblyInfo(a).GetProviderRegistration();
            ProviderRegistrationContext context      = new ProviderRegistrationContext(a);

            registration.RegisterProviderTypes(context);

            return(context.EnumerateValueSources());
        }
示例#6
0
        public ProviderRegistrationAttribute(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }
            if (!typeof(IProviderRegistration).GetTypeInfo().IsAssignableFrom(type))
            {
                throw Failure.NotAssignableFrom("type", typeof(IProviderRegistration), type);
            }

            this.registration = (IProviderRegistration)Activator.CreateInstance(type);
        }
 public CompositeProviderRegistration(IProviderRegistration[] items)
 {
     this.items = items;
 }