Exemple #1
0
 protected static Principal FindByIdentityWithType(PrincipalContext context, Type principalType, IdentityType identityType, string identityValue)
 {
     if (context != null)
     {
         if (identityValue != null)
         {
             if (identityType < IdentityType.SamAccountName || identityType > IdentityType.Guid)
             {
                 throw new InvalidEnumArgumentException("identityType", identityType, typeof(IdentityType));
             }
             else
             {
                 return(Principal.FindByIdentityWithTypeHelper(context, principalType, new IdentityType?(identityType), identityValue, DateTime.UtcNow));
             }
         }
         else
         {
             throw new ArgumentNullException("identityValue");
         }
     }
     else
     {
         throw new ArgumentNullException("context");
     }
 }
Exemple #2
0
 protected static Principal FindByIdentityWithType(PrincipalContext context, Type principalType, string identityValue)
 {
     if (context != null)
     {
         if (identityValue != null)
         {
             IdentityType?nullable = null;
             return(Principal.FindByIdentityWithTypeHelper(context, principalType, nullable, identityValue, DateTime.UtcNow));
         }
         else
         {
             throw new ArgumentNullException("identityValue");
         }
     }
     else
     {
         throw new ArgumentNullException("context");
     }
 }