IsAllowedShortName() public static method

public static IsAllowedShortName ( char c ) : bool
c char
return bool
示例#1
0
 public char?GetShortName(IShortNameArgument arg, string errorMessage)
 {
     if (arg.ShortName.HasValue)
     {
         if (!ArgumentValidation.IsAllowedShortName(arg.ShortName.Value))
         {
             throw new ArgumentIntegrityException(errorMessage);
         }
         return(arg.ShortName.Value);
     }
     return(null);
 }
示例#2
0
        private static Exception ShortNameArgumentMustBeValidCharacter(IArgument arg)
        {
            var sh = arg as IShortNameArgument;

            if (sh != null &&
                sh.ShortName.HasValue &&
                !ArgumentValidation.IsAllowedShortName(sh.ShortName.Value))
            {
                return(new ArgumentIntegrityException(String.Format(
                                                          "Invalid argument {0}: {1}", sh.ShortName,
                                                          ArgumentValidation.IsAllowedShortNameExplanation)));
            }
            return(null);
        }