Exemple #1
0
        private static double AddCount(object value)
        {
            var strVal = value as String;

            if (value != null && (strVal == null || !XLHelper.IsNullOrWhiteSpace(strVal)))
            {
                return(1);
            }
            return(0);
        }
Exemple #2
0
        internal static String GetHeader(MemberInfo mi)
        {
            var attribute = GetXLColumnAttribute(mi);

            if (attribute == null)
            {
                return(null);
            }
            return(XLHelper.IsNullOrWhiteSpace(attribute.Header) ? null : attribute.Header);
        }
Exemple #3
0
 // ** 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;
     }
 }
Exemple #4
0
 // ** 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;
     }
 }