33 lines
612 B
C#
33 lines
612 B
C#
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;
|
|
}
|
|
}
|
|
}
|