public static RlmDatatypeDescription GetRlmEnumDescription(this RlmInputDataType value) { RlmDatatypeDescription retVal = null; FieldInfo fi = value.GetType().GetField(value.ToString()); RlmEnumDescriptionAttribute[] attributes = (RlmEnumDescriptionAttribute[])fi.GetCustomAttributes(typeof(RlmEnumDescriptionAttribute), false); if (attributes != null && attributes.Length > 0) { retVal = new RlmDatatypeDescription(); retVal.Description = attributes[0].Description; retVal.SystemType = attributes[0].SystemType; } return(retVal); }
public static RlmInputDataType GetRlmInputDataType(string systemType) { if (string.IsNullOrEmpty(systemType)) { throw new ArgumentNullException("systemType"); } RlmInputDataType retVal = RlmInputDataType.String; foreach (RlmInputDataType item in Enum.GetValues(typeof(RlmInputDataType))) { var rnnDataTypeDesc = item.GetRlmEnumDescription(); if (rnnDataTypeDesc.SystemType.ToString() == systemType) { retVal = item; break; } } return(retVal); }