private static double AddCount(object value) { var strVal = value as String; if (value != null && (strVal == null || !XLHelper.IsNullOrWhiteSpace(strVal))) { return(1); } return(0); }
internal static String GetHeader(MemberInfo mi) { var attribute = GetXLColumnAttribute(mi); if (attribute == null) { return(null); } return(XLHelper.IsNullOrWhiteSpace(attribute.Header) ? null : attribute.Header); }
// ** implementation private object GetValue(IXLCell cell) { if (_evaluating) { throw new Exception("Circular Reference"); } try { _evaluating = true; var f = cell.FormulaA1; if (XLHelper.IsNullOrWhiteSpace(f)) { return(cell.Value); } else { return(new XLCalcEngine(cell.Worksheet).Evaluate(f)); } } finally { _evaluating = false; } }
// ** implementation private object GetValue(IXLCell cell) { if (_evaluating || (cell as XLCell).IsEvaluating) { throw new InvalidOperationException($"Circular Reference occured during evaluation. Cell: {cell.Address.ToString(XLReferenceStyle.Default, true)}"); } try { _evaluating = true; var f = cell.FormulaA1; if (XLHelper.IsNullOrWhiteSpace(f)) { return(cell.Value); } else { return(new XLCalcEngine(cell.Worksheet).Evaluate(f)); } } finally { _evaluating = false; } }