예제 #1
0
 /// <summary>
 /// Is
 /// </summary>
 /// <param name="enumType"></param>
 /// <param name="str"></param>
 /// <param name="tries"></param>
 /// <param name="ignoreCase"></param>
 /// <param name="enumAct"></param>
 /// <returns></returns>
 public static bool Is(string str, Type enumType, IEnumerable <IConversionTry <string, object> > tries, bool ignoreCase = false, Action <object> enumAct = null) =>
 ValueDeterminer.IsXXX(str, string.IsNullOrWhiteSpace, (s, act) => Is(s, enumType, ignoreCase, act), tries, enumAct);
 /// <summary>
 /// Is
 /// </summary>
 /// <param name="str"></param>
 /// <param name="tries"></param>
 /// <param name="style"></param>
 /// <param name="formatProvider"></param>
 /// <param name="doubleAct"></param>
 /// <returns></returns>
 public static bool Is(string str, IEnumerable <IConversionTry <string, double> > tries,
                       NumberStyles style = NUMBER_STYLES, IFormatProvider formatProvider = null, Action <double> doubleAct = null)
 {
     return(ValueDeterminer.IsXXX(str, string.IsNullOrWhiteSpace,
                                  (s, act) => Is(s, style, formatProvider.SafeNumber(), act), tries, doubleAct));
 }
 /// <summary>
 /// Is
 /// </summary>
 /// <param name="str"></param>
 /// <param name="tries"></param>
 /// <param name="addressAct"></param>
 /// <returns></returns>
 public static bool Is(string str, IEnumerable <IConversionTry <string, IPAddress> > tries, Action <IPAddress> addressAct = null) =>
 ValueDeterminer.IsXXX(str, string.IsNullOrWhiteSpace, Is, tries, addressAct);
 /// <summary>
 /// Is
 /// </summary>
 /// <param name="str"></param>
 /// <param name="tries"></param>
 /// <param name="style"></param>
 /// <param name="formatProvider"></param>
 /// <param name="shortAct"></param>
 /// <returns></returns>
 public static bool Is(string str, IEnumerable <IConversionTry <string, short> > tries,
                       NumberStyles style = NumberStyles.Integer, IFormatProvider formatProvider = null, Action <short> shortAct = null)
 {
     return(ValueDeterminer.IsXXX(str, string.IsNullOrWhiteSpace,
                                  (s, act) => Is(s, style, formatProvider.SafeNumber(), act), tries, shortAct));
 }
 /// <summary>
 /// Is
 /// </summary>
 /// <param name="str"></param>
 /// <param name="tries"></param>
 /// <param name="formatProvider"></param>
 /// <param name="dtAct"></param>
 /// <returns></returns>
 public static bool Is(string str, IEnumerable <IConversionTry <string, TimeSpan> > tries,
                       IFormatProvider formatProvider = null, Action <TimeSpan> dtAct = null)
 {
     return(ValueDeterminer.IsXXX(str, string.IsNullOrWhiteSpace,
                                  (s, act) => Is(s, formatProvider, act), tries, dtAct));
 }
예제 #6
0
 /// <summary>
 /// Is
 /// </summary>
 /// <param name="str"></param>
 /// <param name="tries"></param>
 /// <param name="booleanAct"></param>
 /// <returns></returns>
 public static bool Is(string str, IEnumerable <IConversionTry <string, bool> > tries, Action <bool> booleanAct = null) =>
 ValueDeterminer.IsXXX(str, string.IsNullOrWhiteSpace, Is, tries, booleanAct);