コード例 #1
0
        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);
        }
コード例 #2
0
 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());
 }