private void ReadWorkSheet_dataValidations_ItemDateTime_formula(string value, ref DataValidationFormulaDateTime target) { if (!string.IsNullOrEmpty(value)) { double oADate = default(double); if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out oADate)) { target.Value = DateTime.FromOADate(oADate); } else { target.Formula = value; } } }
internal DataValidationDateTime(string address, DataValidationType validationType) : base(address, validationType) { Formula = new DataValidationFormulaDateTime(); Formula2 = new DataValidationFormulaDateTime(); }
private void ReadWorkSheet_dataValidations_ItemDateTime(DataValidationDateTime dvDateTime, XElement node) { XElement formulaNode = node.Element(XName.Get("formula1", ExcelCommon.Schema_WorkBook_Main.NamespaceName)); if (formulaNode != null) { DataValidationFormulaDateTime formulaValue = new DataValidationFormulaDateTime(); ReadWorkSheet_dataValidations_ItemDateTime_formula(formulaNode.Value, ref formulaValue); dvDateTime.Formula = formulaValue; } formulaNode = node.Element(XName.Get("formula2", ExcelCommon.Schema_WorkBook_Main.NamespaceName)); if (formulaNode != null) { DataValidationFormulaDateTime formulaValue = new DataValidationFormulaDateTime(); ReadWorkSheet_dataValidations_ItemDateTime_formula(formulaNode.Value, ref formulaValue); dvDateTime.Formula2 = formulaValue; } }