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

29 lines
682 B
C#

using System;
namespace CPF.ReoGrid
{
public class CustomBodyTypeProviderCollection
{
internal CustomBodyTypeProviderCollection()
{
}
public void Add(Type type, string identifier, RGFCustomBodyHandler handler)
{
RGFPersistenceProvider.CustomBodyTypeIdentifiers[type] = identifier;
RGFPersistenceProvider.CustomBodyTypeHandlers[identifier] = handler;
}
public void Remove(Type type)
{
string key;
bool flag = RGFPersistenceProvider.CustomBodyTypeIdentifiers.TryGetValue(type, out key);
if (flag)
{
RGFPersistenceProvider.CustomBodyTypeHandlers.Remove(key);
}
RGFPersistenceProvider.CustomBodyTypeIdentifiers.Remove(type);
}
}
}