CPF/CPF.ReoGrid/AutoFillSectionEntryFactory.cs

33 lines
612 B
C#
Raw Permalink Normal View History

2024-06-24 10:15:59 +08:00
using System;
using CPF.ReoGrid.Utility;
namespace CPF.ReoGrid
{
public static class AutoFillSectionEntryFactory
{
public static IAutoFillSectionEntry Create(object value)
{
bool flag = value == null;
IAutoFillSectionEntry result;
if (flag)
{
result = new NullAutoFillSectionEntry();
}
else
{
double value2;
bool flag2 = CellUtility.TryGetNumberData(value, out value2);
if (flag2)
{
result = new NumericalAutoFillSectionEntry(value2);
}
else
{
result = new TextAutoFillSectionEntry(value.ToString());
}
}
return result;
}
}
}