/// <summary>
        /// Gets the data type for an associated type name.
        /// </summary>
        /// <param name="typeName">A type name.</param>
        /// <returns>A data type definition.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="typeName"/> is <c>null</c>.</exception>
        protected static DataType GetDataType(Identifier typeName)
        {
            if (typeName == null)
            {
                throw new ArgumentNullException(nameof(typeName));
            }

            return(StringToDataTypeMap.ContainsKey(typeName)
                ? StringToDataTypeMap[typeName]
                : DataType.Unknown);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the type of the data.
        /// </summary>
        /// <param name="typeName">Name of the type.</param>
        /// <returns>A general data type class.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="typeName"/> is <c>null</c>, empty or whitespace.</exception>
        protected static DataType GetDataType(string typeName)
        {
            if (typeName.IsNullOrWhiteSpace())
            {
                throw new ArgumentNullException(nameof(typeName));
            }

            return(StringToDataTypeMap.ContainsKey(typeName)
                ? StringToDataTypeMap[typeName]
                : DataType.Unknown);
        }