public static ReactivePropertyValidator <string> IfNotUri(this ReactivePropertyValidator <string> This, string errorMessage)
 {
     return(This.IfFalse(s =>
     {
         Uri uri;
         return Uri.TryCreate(s, UriKind.Absolute, out uri);
     }, errorMessage));
 }
Пример #2
0
 public static ReactivePropertyValidator <string> IfNotUri(this ReactivePropertyValidator <string> This, string errorMessage)
 {
     return(This.IfFalse(s =>
     {
         try
         {
             new UriBuilder(s);
             return true;
         }
         catch
         {
             return false;
         }
     }, errorMessage));
 }
 public static ReactivePropertyValidator <string> DirectoryExists(this ReactivePropertyValidator <string> This, string errorMessage)
 {
     return(This.IfFalse(Directory.Exists, errorMessage));
 }
 public static ReactivePropertyValidator <string> IfPathNotRooted(this ReactivePropertyValidator <string> This, string errorMessage)
 {
     return(This.IfFalse(Path.IsPathRooted, errorMessage));
 }
        public static ReactivePropertyValidator <string> IfNotMatch(this ReactivePropertyValidator <string> This, string pattern, string errorMessage)
        {
            var regex = new Regex(pattern);

            return(This.IfFalse(regex.IsMatch, errorMessage));
        }