private static Dictionary <object, string> CreateDataTypeToName() { Dictionary <object, string> dictionary = new Dictionary <object, string>(); foreach (DataType dataType in Enum.GetValues(typeof(DataType))) { if (dataType != DataType.Custom && DataTypeUtil.KnownDataTypeToString(dataType) == null) { string name = Enum.GetName(typeof(DataType), (object)dataType); dictionary[(object)dataType] = name; } } return(dictionary); }
internal static string ToDataTypeName(this DataTypeAttribute attribute, Func <DataTypeAttribute, bool> isDataType = null) { if (isDataType == null) { isDataType = (Func <DataTypeAttribute, bool>)(t => t.GetType().Equals(typeof(DataTypeAttribute))); } if (isDataType(attribute)) { string str = DataTypeUtil.KnownDataTypeToString(attribute.DataType); if (str == null) { DataTypeUtil._dataTypeToName.Value.TryGetValue((object)attribute.DataType, out str); } if (str != null) { return(str); } } return(attribute.GetDataTypeName()); }