CPF/CPF.ReoGrid/CellTypes/CellTypesManager.cs
2024-06-24 10:15:59 +08:00

43 lines
990 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace CPF.ReoGrid.CellTypes
{
public static class CellTypesManager
{
public static Dictionary<string, Type> CellTypes
{
get
{
bool flag = CellTypesManager.cellTypes == null;
if (flag)
{
CellTypesManager.cellTypes = new Dictionary<string, Type>();
try
{
Type[] types = Assembly.GetAssembly(typeof(Worksheet)).GetTypes();
foreach (Type type in from t in types
orderby t.Name
select t)
{
bool flag2 = type != typeof(ICellBody) && type != typeof(CellBody) && (type.IsSubclassOf(typeof(ICellBody)) || type.IsSubclassOf(typeof(CellBody))) && type.IsPublic && !type.IsAbstract;
if (flag2)
{
CellTypesManager.cellTypes[type.Name] = type;
}
}
}
catch
{
}
}
return CellTypesManager.cellTypes;
}
}
private static Dictionary<string, Type> cellTypes;
}
}