protected T ReadCellValue(ExcelWorksheet worksheet, string pos, [CallerMemberName] string name = null) { T ret; var value = worksheet.Cells[pos].Value; readExceptionRules = new ExceptionDecoration(); readExceptionRules = new noNullreadException(readExceptionRules); readExceptionRules.checkWithValue(value, name); var type = typeof(T); var converter = TypeDescriptor.GetConverter(type); ret = (T)converter.ConvertFromString(value.ToString()); readExceptionRules = new noNegativereadException(readExceptionRules); readExceptionRules.checkWithValue(ret, name); return(ret); }
public noNegativereadException(IReadExceptionRules readExceptionRules) { this.readExceptionRule = readExceptionRules; }
public noNullreadException(IReadExceptionRules readExceptionRules) { this.readExceptionRule = readExceptionRules; }