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

            this.registration = ProviderRegistration.FromKind(knownType);
        }
 internal static IProviderRegistration FromKind(ProviderRegistrationType kind)
 {
     if (kind == ProviderRegistrationType.Default)
         return ProviderRegistration.Default;
     else
         return ProviderRegistration.Explicit;
 }
Beispiel #3
0
        public ProviderRegistrationAttribute(ProviderRegistrationType knownType)
        {
            if (knownType == ProviderRegistrationType.Custom)
            {
                throw RuntimeFailure.UseProviderRegistrationAttributeOverload("knownType", knownType);
            }

            this.registration = ProviderRegistration.FromKind(knownType);
        }
 internal static IProviderRegistration FromKind(ProviderRegistrationType kind)
 {
     if (kind == ProviderRegistrationType.Default)
     {
         return(ProviderRegistration.Default);
     }
     else
     {
         return(ProviderRegistration.Explicit);
     }
 }
 public static ArgumentOutOfRangeException UseProviderRegistrationAttributeOverload(
     string argumentName, ProviderRegistrationType type)
 {
     return Failure.Prepare(new ArgumentOutOfRangeException(argumentName, type, SR.UseProviderRegistrationAttributeOverload()));
 }
Beispiel #6
0
 public static ArgumentOutOfRangeException UseProviderRegistrationAttributeOverload(
     string argumentName, ProviderRegistrationType type)
 {
     return(Failure.Prepare(new ArgumentOutOfRangeException(argumentName, type, SR.UseProviderRegistrationAttributeOverload())));
 }