private void ReadWorkSheet_dataValidations_ItemTime_formula(string value, ref DataValidationFormulaTime target) { if (!string.IsNullOrEmpty(value)) { decimal time = default(decimal); if (decimal.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out time)) { target.Value = new TimeWrapper(time); } else { target.Formula = value; } } }
internal DataValidationTime(string address, DataValidationType validationType) : base(address, validationType) { Formula = new DataValidationFormulaTime(); Formula2 = new DataValidationFormulaTime(); }
private void ReadWorkSheet_dataValidations_ItemTime(DataValidationTime dvTime, XElement node) { XElement formulaNode = node.Element(XName.Get("formula1", ExcelCommon.Schema_WorkBook_Main.NamespaceName)); if (formulaNode != null) { DataValidationFormulaTime formulaValue = new DataValidationFormulaTime(); ReadWorkSheet_dataValidations_ItemTime_formula(formulaNode.Value, ref formulaValue); dvTime.Formula = formulaValue; } formulaNode = node.Element(XName.Get("formula2", ExcelCommon.Schema_WorkBook_Main.NamespaceName)); if (formulaNode != null) { DataValidationFormulaTime formulaValue = new DataValidationFormulaTime(); ReadWorkSheet_dataValidations_ItemTime_formula(formulaNode.Value, ref formulaValue); dvTime.Formula2 = formulaValue; } }