Example #1
0
        private void ReadWorkSheet_dataValidations_ItemDecima(DataValidationDecimal dvDecima, XElement node)
        {
            XElement formulaNode = node.Element(XName.Get("formula1", ExcelCommon.Schema_WorkBook_Main.NamespaceName));
            if (formulaNode != null)
            {
                DataValidationFormulaDecimal formulaValue = new DataValidationFormulaDecimal();
                ReadWorkSheet_dataValidations_ItemDecima_formula(formulaNode.Value, ref formulaValue);
                dvDecima.Formula = formulaValue;
            }

            formulaNode = node.Element(XName.Get("formula2", ExcelCommon.Schema_WorkBook_Main.NamespaceName));
            if (formulaNode != null)
            {
                DataValidationFormulaDecimal formulaValue = new DataValidationFormulaDecimal();
                ReadWorkSheet_dataValidations_ItemDecima_formula(formulaNode.Value, ref formulaValue);
                dvDecima.Formula2 = formulaValue;
            }
        }
Example #2
0
 private void ReadWorkSheet_dataValidations_ItemDecima_formula(string value, ref DataValidationFormulaDecimal formulaValue)
 {
     if (!string.IsNullOrEmpty(value))
     {
         double dValue = default(double);
         if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out dValue))
         {
             formulaValue.Value = dValue;
         }
         else
         {
             formulaValue.Formula = value;
         }
     }
 }
 internal DataValidationDecimal(string address, DataValidationType validationType)
     : base(address, validationType)
 {
     Formula  = new DataValidationFormulaDecimal();
     Formula2 = new DataValidationFormulaDecimal();
 }