示例#1
0
文件: Settings.cs 项目: satr/rvslite
 public static object GetValueBy(string stringValue){
     string valueText = stringValue.Replace(" ", string.Empty);
     var intChecker = new IntChecker(valueText);
     if (intChecker.IsValid)
         return intChecker.Value;
     var boolChecker = new BoolChecker(valueText);
     if (boolChecker.IsValid)
         return boolChecker.Value;
     return valueText;
 }
示例#2
0
文件: Settings.cs 项目: satr/rvslite
 public static bool GetBoolValueBy(object value){
     if (value == null)
         return false;
     var intChecker = new IntChecker(value);
     if (intChecker.IsValid)
         return intChecker.Value != 0;
     var boolChecker = new BoolChecker(value);
     if (boolChecker.IsValid)
         return boolChecker.Value;
     return !string.IsNullOrEmpty(value.ToString());
 }